From 92e7603aa5e6fa1a400cb01ba21f50e9a47a462f Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 26 Feb 2013 13:14:06 +0000 Subject: [PATCH] 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 --- lib/ice-coder.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 52f1d55..b227f5b 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -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"; }