diff options
author | Silvio <s1lv10@uol.com.br> | 2009-10-03 18:29:33 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2009-10-03 18:29:33 -0300 |
commit | 910ebaabda18c1477de458b22f45a0f7f59eccdb (patch) | |
tree | fe58659855409867129882ef4b782dddc0d44a74 | |
parent | a6de1b6cdb31e96418cc1a9328b0d34378c488f3 (diff) | |
download | finder_menu-910ebaabda18c1477de458b22f45a0f7f59eccdb.tar.gz finder_menu-910ebaabda18c1477de458b22f45a0f7f59eccdb.tar.bz2 |
Bugfix: hopefully working version
-rw-r--r-- | finder_menu.js | 22 |
1 files 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<uls.length;u++) {
- cssjs('remove',uls[u],showClass);
+ for(var u=0;u<parentUls.length;u++) {
+ cssjs('remove',parentUls[u],showClass);
}
}
@@ -96,24 +98,22 @@ function ul2finder() if (window.finderPrevious != null && window.finderPrevious != this.id) {
previous = document.getElementById(window.finderPrevious);
- uls = previous.parentNode.getElementsByTagName('ul');
+ previousUls = previous.parentNode.getElementsByTagName('ul');
current = this.parentNode.getElementsByTagName('ul')[0];
- if (!connected(uls[0],current)) {
+ if (!connected(previousUls[0],current)) {
window.finderOpened[previous.id] = false;
// change the current link from open to parent
// and hide the current nested list
cssjs('add',previous,parentClass);
cssjs('remove',previous,openClass);
- for(var t=0;t<uls.length;t++) {
- cssjs('remove',uls[t],showClass);
+ for(var t=0;t<previousUls.length;t++) {
+ cssjs('remove',previousUls[t],showClass);
}
- previous.innerHTML = window.finderOpened[previous.id];
}
}
window.finderPrevious = this.id;
- this.innerHTML = window.finderOpened[this.id];
// don't follow the real HREF of the link
return false;
}
|