diff --git a/lib/ice-coder.js b/lib/ice-coder.js index a522281..8f4be48 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1000,7 +1000,7 @@ var ICEcoder = { // Update the file manager tree list on demand updateFileManagerList: function(action,location,file,perms,oldName,uploaded,fileOrFolder) { - var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver; + var actionElemType, cssStyle, perms, targetElem, locNest, newText, innerLI, newUL, newLI, elemType, nameLI, shortURL, newMouseOver; // Adding files if (action=="add" && !top.get('filesFrame').contentWindow.document.getElementById(location.replace(top.iceRoot,"").replace(/\/$/, "").replace(/\//g,"|")+"|"+file)) { @@ -1010,8 +1010,9 @@ var ICEcoder = { perms = actionElemType=="file" ? 664 : 705; // Identify our target element & the first child element in it's location - if (!location) {location=""} + if (!location) {location="/"} location = location.replace(top.iceRoot,"/"); + location = location.replace("//","/"); targetElem = top.get('filesFrame').contentWindow.document.getElementById(location.replace(/\//g,"|")); locNest = targetElem.parentNode.parentNode.nextSibling; newText = document.createTextNode("\n"); @@ -1101,10 +1102,12 @@ var ICEcoder = { // Deleting files if (action=="delete") { - // Simply get our target and make it dissapear - targetElem = top.get('filesFrame').contentWindow.document.getElementById( - (top.iceRoot == "" ? location.replace(/\/$/, "").replace(/\//g,"|") : "") - +"|"+file).parentNode.parentNode; + if (!location) {location=""} + location = location.replace(top.iceRoot,"/"); + location = location.replace("//","/"); + location = location.replace(/\/$/, "").replace(/\//g,"|"); + targetElem = (location +"|"+file).replace("||","|"); + targetElem = top.get('filesFrame').contentWindow.document.getElementById(targetElem).parentNode.parentNode; top.ICEcoder.openCloseDir(targetElem.childNodes[0],false); targetElem.parentNode.removeChild(targetElem); }