Don't look to nextSibling & open/close fix

No need to set node to nextSibling again, only once is needed
If condition is now else if and calling the get-tree.php script
subsequent times and only if we're opening
This means we fix the open/close dir problem and also reload the dir
each time we open
This commit is contained in:
Matt Pass
2013-02-26 13:14:06 +00:00
parent e3431f201c
commit 92e7603aa5

View File

@@ -382,12 +382,13 @@ var ICEcoder = {
dir.onclick = function() {top.ICEcoder.openCloseDir(this,false)};
var node = dir.parentNode;
if (node.nextSibling) {node = node.nextSibling};
if (node.nextSibling) {node = node.nextSibling};
if (load) {
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-tree.php?location="+dir.childNodes[1].id;
}
if (node && node.tagName=="UL") {
} else if (node && node.tagName=="UL") {
var d = node.style.display=="none";
if (d) {
top.ICEcoder.filesFrame.contentWindow.frames['fileControl'].location.href = "lib/get-tree.php?location="+dir.childNodes[1].id;
}
node.style.display = d ? "block" : "none";
dir.parentNode.className=dir.className = d ? "pft-directory dirOpen" : "pft-directory";
}