Skip to content

Commit 06676f4

Browse files
committed
Accordion: Fixed key handling.
1 parent 927857c commit 06676f4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ui/jquery.ui.accordion.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,20 @@ $.widget( "ui.accordion", {
162162
return;
163163
}
164164

165+
if ( key === "event" ) {
166+
if ( this.options.event ) {
167+
this.headers.unbind( this.options.event + ".accordion", this._eventHandler );
168+
}
169+
this._setupEvents( value );
170+
}
171+
165172
this._super( "_setOption", key, value );
166173

167174
// setting collapsible: false while collapsed; open first panel
168175
if ( key === "collapsible" && !value && this.options.active === false ) {
169176
this._activate( 0 );
170177
}
171178

172-
if ( key === "event" ) {
173-
this._setupEvents( value );
174-
}
175-
176179
if ( key === "icons" ) {
177180
this._destroyIcons();
178181
if ( value ) {
@@ -294,7 +297,6 @@ $.widget( "ui.accordion", {
294297
},
295298

296299
_setupEvents: function( event ) {
297-
this.headers.unbind( ".accordion" );
298300
if ( event ) {
299301
this.headers.bind( event.split( " " ).join( ".accordion " ) + ".accordion",
300302
$.proxy( this, "_eventHandler" ) );

0 commit comments

Comments
 (0)