Ticket #4576 (closed enhancement: fixed)

Opened 15 months ago

Last modified 7 weeks ago

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@…

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

index.html Download (1.7 KB) - added by margustiru 15 months ago.
minimized jQuery UI Example Page

Change History

Changed 15 months ago by margustiru

minimized jQuery UI Example Page

Changed 15 months 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...

Changed 15 months 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.

Changed 13 months ago by rdworth

  • status changed from new to closed
  • resolution set to fixed

Fixed in r3044

Changed 12 months 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?!

Changed 10 months 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?

Changed 8 months ago by crexland

Changed 8 months ago by rnbguru

From what I've seen, it looks like it's fixed.  Hair Crimpers

Note: See TracTickets for help on using tickets.