File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -162,17 +162,20 @@ $.widget( "ui.accordion", {
162
162
return ;
163
163
}
164
164
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
+
165
172
this . _super ( "_setOption" , key , value ) ;
166
173
167
174
// setting collapsible: false while collapsed; open first panel
168
175
if ( key === "collapsible" && ! value && this . options . active === false ) {
169
176
this . _activate ( 0 ) ;
170
177
}
171
178
172
- if ( key === "event" ) {
173
- this . _setupEvents ( value ) ;
174
- }
175
-
176
179
if ( key === "icons" ) {
177
180
this . _destroyIcons ( ) ;
178
181
if ( value ) {
@@ -294,7 +297,6 @@ $.widget( "ui.accordion", {
294
297
} ,
295
298
296
299
_setupEvents : function ( event ) {
297
- this . headers . unbind ( ".accordion" ) ;
298
300
if ( event ) {
299
301
this . headers . bind ( event . split ( " " ) . join ( ".accordion " ) + ".accordion" ,
300
302
$ . proxy ( this , "_eventHandler" ) ) ;
You can’t perform that action at this time.
0 commit comments