From 910ebaabda18c1477de458b22f45a0f7f59eccdb Mon Sep 17 00:00:00 2001 From: Silvio Date: Sat, 3 Oct 2009 18:29:33 -0300 Subject: Bugfix: hopefully working version --- finder_menu.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/finder_menu.js b/finder_menu.js index 1a56a51..96fed45 100644 --- a/finder_menu.js +++ b/finder_menu.js @@ -39,10 +39,13 @@ function ul2finder() { continue; } + + // adjust the link var newa=document.createElement('a'); newa.href='#'; newa.appendChild(document.createTextNode(lis[i].firstChild.nodeValue)); lis[i].replaceChild(newa,lis[i].firstChild); + // otherwise apply the parent class cssjs('add',newa,parentClass); @@ -64,7 +67,6 @@ function ul2finder() ref = uls[i].parentNode.getElementsByTagName('a')[0]; if (ref != this && !isparent(uls[i],ul)) { window.finderOpened[ref.id] = false; - ref.innerHTML = false; cssjs('add',uls[i],hideClass); cssjs('remove',uls[i],showClass); cssjs('remove',ref,openClass); @@ -73,22 +75,22 @@ function ul2finder() } } - uls = this.parentNode.getElementsByTagName('ul'); + parentUls = this.parentNode.getElementsByTagName('ul'); if (window.finderOpened[this.id] == false) { window.finderOpened[this.id] = true; // change the current link from parent to open // and show the current nested list cssjs('remove',this,parentClass); cssjs('add',this,openClass); - cssjs('add',uls[0],showClass); + cssjs('add',parentUls[0],showClass); } else { window.finderOpened[this.id] = false; // change the current link from open to parent // and hide the current nested list cssjs('add',this,parentClass); cssjs('remove',this,openClass); - for(var u=0;u