From: Scott González Date: Tue, 20 Jul 2010 20:13:44 +0000 (-0400) Subject: Accordion: Use this.headers instead of parsing the DOM to find headers when determini... X-Git-Tag: 1.8.3~30 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f99068bb4ff7fc0ceec154ac8e3b63e088246047;p=jquery-ui.git 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. --- diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 1d13e9566..f21b63cce 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -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)) {