From f5fa8fbf4bb5b7c848cbc209e90592d0056ad579 Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 1 Oct 2009 13:06:06 -0300 Subject: Initial code to hide the menu (6) --- finder_menu.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/finder_menu.js b/finder_menu.js index 951ac46..376ddd5 100644 --- a/finder_menu.js +++ b/finder_menu.js @@ -72,17 +72,18 @@ function ul2finder() } } - if (cssjs('check',this,parentClass)) { - alert('yes'); + if (this.isOpened == false || this.isOpened == null) { + this.isOpened = 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 { + this.isOpened = 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); + cssjs('remove',this.parentNode.getElementsByTagName('ul')[0],showClass); } // don't follow the real HREF of the link -- cgit v1.2.3