Search and Top Navigation
#8336 closed bug (duplicate)
Opened May 20, 2012 05:38AM UTC
Closed May 20, 2012 06:26PM UTC
Last modified May 21, 2012 06:33AM UTC
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.
Attachments (0)
Change History (3)
Changed May 20, 2012 06:26PM UTC by comment:1
| resolution: | → duplicate |
|---|---|
| status: | new → closed |
This works in master. Also, rerunning
_create()is a bad idea, so is unbinding without a namespace.