aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <s1lv10@uol.com.br>2009-10-01 22:18:23 -0300
committerSilvio <s1lv10@uol.com.br>2009-10-01 22:18:23 -0300
commit364a3b8f5166a5ac634411b4edbc51f4a512f2ff (patch)
treeb125c2ebb84a4a9bcd080778687aa1a4570704d7
parentcee2b9e1f08e2253fc2e3f781300344d49765453 (diff)
downloadfinder_menu-364a3b8f5166a5ac634411b4edbc51f4a512f2ff.tar.gz
finder_menu-364a3b8f5166a5ac634411b4edbc51f4a512f2ff.tar.bz2
Debugging js code
-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;
}