Ticket #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: | margus.tiru@… |
| Blocking: | Blocked by: |
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
Change History
Changed 4 years ago by margustiru
-
attachment
index.html
added
comment:1 Changed 4 years ago by margustiru
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 4 years ago by joern.zaefferer
- Priority changed from major to minor
- Type changed from bug to enhancement
- Milestone changed from TBD to 1.8
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:3 Changed 4 years ago by rdworth
- Status changed from new to closed
- Resolution set to fixed
Fixed in r3044
comment:4 Changed 4 years ago by andreas
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 4 years ago by haayman
I have the same question. Is it possible to fix this in the current release? Or should we use 1.8? Is it stable?
comment:9 Changed 3 years ago by rnbguru
From what I've seen, it looks like it's fixed. Hair Crimpers


minimized jQuery UI Example Page