From f99068bb4ff7fc0ceec154ac8e3b63e088246047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 20 Jul 2010 16:13:44 -0400 Subject: [PATCH] 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. --- ui/jquery.ui.accordion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 1d13e9566f1..f21b63cce58 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)) {