accordion: simplified find-header-element code, thanks Ariel

This commit is contained in:
Jörn Zaefferer 2008-06-22 19:08:35 +00:00
parent b876be002d
commit dd584fbe95

View File

@ -179,9 +179,8 @@ function clickHandler(event) {
// due to the event delegation model, we have to check if one // due to the event delegation model, we have to check if one
// of the parent elements is our actual header, and find that // of the parent elements is our actual header, and find that
if ( clicked.parents(options.header).length ) { // otherwise stick with the initial target
clicked = clicked.parents(options.header + ":first"); clicked = $( clicked.parents(options.header)[0] || clicked );
}
var clickedActive = clicked[0] == options.active[0]; var clickedActive = clicked[0] == options.active[0];