Accordion: Use this.headers instead of parsing the DOM to find headers when determining which panel is active. Fixes #5841 - Accordion active property inaccurate if nested accordion is present.

This commit is contained in:
Scott González 2010-07-20 16:13:44 -04:00
parent e85615fc6b
commit f99068bb4f

View File

@ -302,7 +302,7 @@ $.widget("ui.accordion", {
// TODO the option is changed, is that correct?
// TODO if it is correct, shouldn't that happen after determining that the click is valid?
o.active = o.collapsible && clickedIsActive ? false : $('.ui-accordion-header', this.element).index(clicked);
o.active = o.collapsible && clickedIsActive ? false : this.headers.index(clicked);
// if animations are still active, or the active header is the target, ignore click
if (this.running || (!o.collapsible && clickedIsActive)) {