From dd584fbe9527c88e6adb40653224143abb6b4961 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Sun, 22 Jun 2008 19:08:35 +0000 Subject: [PATCH] accordion: simplified find-header-element code, thanks Ariel --- ui/ui.accordion.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index c7828cd9d..089073a16 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -179,9 +179,8 @@ function clickHandler(event) { // due to the event delegation model, we have to check if one // of the parent elements is our actual header, and find that - if ( clicked.parents(options.header).length ) { - clicked = clicked.parents(options.header + ":first"); - } + // otherwise stick with the initial target + clicked = $( clicked.parents(options.header)[0] || clicked ); var clickedActive = clicked[0] == options.active[0]; -- 2.39.5