]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Fix unbinding of accordion event option when dealing with multiple events...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 7 Mar 2012 18:17:09 +0000 (19:17 +0100)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Wed, 7 Mar 2012 18:17:09 +0000 (19:17 +0100)
tests/unit/accordion/accordion_options.js
ui/jquery.ui.accordion.js

index 8206b1d6234e62f0eaf4000b22bc135d0df7ebf9..74a9a31771b23ff54856928a92ff28dba037c9ab 100644 (file)
@@ -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 );
 
index f4747d168e1fe5d31fcf470290f6fd9118a72038..bf8434c6de5dc7cb67c2a491458a34bb6b91c46a 100644 (file)
@@ -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 );
                }