Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8336 closed bug (duplicate)

ui.accordion: Setting 'event' option after init does not rebind the event.

Reported by: mkemmerling Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.accordion Version: 1.8.19
Keywords: Cc:
Blocked by: Blocking:

Description

Setting the 'event' option of the accordion widget after init does not rebind the event since the event is bound on creation of the widget only.

I worked around this by adding the following lines to _setOption:

if ( key === 'event' ) {
    this.headers.unbind( this.options.event );
    this._create();
}

This is in the spirit of ui.tabs which calls its create method (_tabify) for almost all options set after init.

Recreating the accordion does not seem to do any harm, but I am not sure about this. Of course the unbinding should better be done in _create istelf before binding the event.

Change History (3)

comment:1 Changed 7 years ago by Scott González

Resolution: duplicate
Status: newclosed

This works in master. Also, rerunning _create() is a bad idea, so is unbinding without a namespace.

comment:2 Changed 7 years ago by Scott González

Duplicate of #6740.

comment:3 Changed 7 years ago by mkemmerling

Thanks a lot for clarification and comments. I searched the tickets first but overlooked #6740. My fault, sorry.

Note: See TracTickets for help on using tickets.