aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--finder_menu.js46
1 files changed, 25 insertions, 21 deletions
diff --git a/finder_menu.js b/finder_menu.js
index a03db53..7f08a94 100644
--- a/finder_menu.js
+++ b/finder_menu.js
@@ -59,30 +59,34 @@ function ul2finder()
if(uls[i].getElementsByTagName('ul')[j] ==
this.parentNode.getElementsByTagName('ul')[0])
{
- if (window.finderOpened[i] == false) {
- window.finderOpened[i] = true;
- found=true;
- break;
- }
+ found=true;
+ break;
}
}
- // and hide all others
- if(!found)
- {
- cssjs('add',uls[i],hideClass);
- cssjs('remove',uls[i],showClass);
- cssjs('remove',uls[i].parentNode.getElementsByTagName('a')[0],openClass);
- cssjs('add',uls[i].parentNode.getElementsByTagName('a')[0],parentClass);
- } else {
- window.finderOpened[i] = false;
- cssjs('remove',uls[i].parentNode.getElementsByTagName('a')[0],parentClass);
- }
- }
- // change the current link from parent to open
- cssjs('swap',this,parentClass,openClass)
- // show the current nested list
- cssjs('add',this.parentNode.getElementsByTagName('ul')[0],showClass)
+ // and hide all others
+ if(!found)
+ {
+ cssjs('add',uls[i],hideClass)
+ cssjs('remove',uls[i],showClass)
+ cssjs('remove',uls[i].parentNode.getElementsByTagName('a')[0],openClass)
+ cssjs('add',uls[i].parentNode.getElementsByTagName('a')[0],parentClass)
+ }
+ }
+
+ if (window.finderOpened[i] == false) {
+ window.finderOpened[i] = true;
+ // change the current link from parent to open
+ cssjs('swap',this,parentClass,openClass);
+ // show the current nested list
+ cssjs('add',this.parentNode.getElementsByTagName('ul')[0],showClass);
+ } else {
+ window.finderOpened[i] = false;
+ // change the current link from open to parent
+ cssjs('swap',this,openClass,parentClass);
+ // hide the current nested list
+ cssjs('add',this.parentNode.getElementsByTagName('ul')[0],hideClass);
+ }
// don't follow the real HREF of the link
return false;