#4576 closed enhancement (fixed)
Accordion 'Active' property not change'ing
Reported by: | margustiru | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.8 |
Component: | ui.accordion | Version: | 1.7.1 |
Keywords: | accordion active | Cc: | [email protected]… |
Blocked by: | Blocking: |
Description
Seems like accordion property 'Active' is not changing when accordion is changed (another item selected).
alert($("#accordion").accordion('option','active'));
returns always the active:index it was set initially! If nothing was set initially, it always returns null.
Code (from downloaded jQuery UI Example Page):
Accordion $("#accordion").accordion({ header: "h3", active:1, change: function(event, ui) { alert($("#accordion").accordion('option','active')); }}); Will return always 1
Accordion $("#accordion").accordion({ header: "h3", change: function(event, ui) { alert($("#accordion").accordion('option','active')); }}); Will return always null
Attachments (1)
Change History (7)
Changed 14 years ago by
Attachment: | index.html added |
---|
comment:1 Changed 14 years ago by
I digged in ui.accordion and maybe corrected the bug by adding
o.active = this.headers.index(this.active[0]);
to line 271 in ui.accordion.js like that:
this.active = clickedIsActive ? $([]) : clicked; o.active = this.headers.index(this.active[0]); this._toggle(toShow, toHide, data, clickedIsActive, down);
hopefully it works...
comment:2 Changed 14 years ago by
Milestone: | TBD → 1.8 |
---|---|
Priority: | major → minor |
Type: | bug → enhancement |
Not sure if this is a valid issue: We handle all options as read-only. On the other hand, there should be a way to get the active panel, which is currently missing.
comment:4 Changed 13 years ago by
So this is fixed in trunk with milestone 1.8, nice.
but how do i get the current index of the current open accordion in 1.7.x? you dont maintain support for bugs in 1.7.x?!
comment:6 Changed 13 years ago by
I have the same question. Is it possible to fix this in the current release? Or should we use 1.8? Is it stable?
minimized jQuery UI Example Page