aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--finder_menu.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/finder_menu.js b/finder_menu.js
index aedc960..dc41579 100644
--- a/finder_menu.js
+++ b/finder_menu.js
@@ -12,7 +12,7 @@ function ul2finder()
var showClass='shown';
var hideClass='hidden';
var openClass='open';
- window.finderOpened = [];
+ window.finderOpened = new Object();
// check if our finder list exists, if not, stop all activities
finder=document.getElementById('finder');
@@ -88,18 +88,21 @@ function ul2finder()
// TODO: check and fix
// unset window.finderNode for all other nodes that aren't children
- children = this.childNodes;
+ children = this.parentNode.childNodes;
refs = document.getElementById('finder').getElementsByTagName('a');
for (var i=0;i<refs.length;i++) {
found = false;
if (refs[i] != this) {
+ // search at children
for(var j=0;j<children.lenght;j++) {
if (refs[i] == children[j]) {
found = true;
}
}
+ // TODO: search at parent
if (!found) {
window.finderOpened[refs[i].id] = false;
+ refs[i].innerHTML = window.finderOpened[refs[i].id];
}
}
}
@@ -113,9 +116,11 @@ function ul2finder()
// TODO: check and fix
for(var j=0;j<children.lenght;j++) {
cssjs('remove',children[j],showClass);
+ children[j].innerHTML = window.finderOpened[refs[i].id];
}
}
+ this.innerHTML = window.finderOpened[this.id];
// don't follow the real HREF of the link
return false;
}