Skip to content
Permalink
Browse files

Accordion: Fix unbinding of accordion event option when dealing with …

…multiple events. Make sure to unbind only those namespaced to .accordion
  • Loading branch information
jzaefferer committed Mar 7, 2012
1 parent 1d68f13 commit 050958277317cf127b98f8ac26f70f57cf147b26
Showing with 2 additions and 2 deletions.
  1. +1 −0 tests/unit/accordion/accordion_options.js
  2. +1 −2 ui/jquery.ui.accordion.js
@@ -152,6 +152,7 @@ test( "{ event: custom }", function() {

// ensure old event handlers are unbound
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom2" );
equal( element.accordion( "option", "active" ), 2 );
accordion_state( element, 0, 0, 1 );

@@ -162,8 +162,7 @@ $.widget( "ui.accordion", {

if ( key === "event" ) {
if ( this.options.event ) {
// TODO: this is incorrect for multiple events (see _setupEvents)
this.headers.unbind( this.options.event + ".accordion", this._eventHandler );
this.headers.unbind( this.options.event.split( " " ).join( ".accordion " ) + ".accordion", this._eventHandler );
}
this._setupEvents( value );
}

0 comments on commit 0509582

Please sign in to comment.
You can’t perform that action at this time.