From c3dbc4187f348a3cf09eb7e7dd88421bef98969c Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 21 Sep 2012 14:22:14 +0100 Subject: [PATCH] Remove iceRoot from location & perms file path Clear iceRoot from the beginning of location (needed for when you set your own ICEroot), so it doesn't cause DOM ID issues/mismatches Also remove it from the file path passed through to file-control when changing perms when you have your own ICEroot and don't show in server message either --- lib/coder.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/coder.js b/lib/coder.js index 8fd2fcb..31bde48 100644 --- a/lib/coder.js +++ b/lib/coder.js @@ -1229,6 +1229,7 @@ var ICEcoder = { // Identify our target element & the first child element in it's location if (!location) {location="/"} + location = location.replace(top.iceRoot,""); targetElem = document.getElementById('filesFrame').contentWindow.document.getElementById(location.replace(/\//g,"|")); locNest = targetElem.parentNode.parentNode.nextSibling; if (locNest.nextSibling) {locNest = locNest.nextSibling} @@ -1722,8 +1723,8 @@ var ICEcoder = { // Change permissions on a file/folder chmod: function(file,perms) { top.ICEcoder.showHide('hide',top.document.getElementById('blackMask')); - top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file+"&perms="+perms); - top.ICEcoder.serverMessage('chMod '+perms+' on
'+file); + top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file.replace(top.iceRoot,"")+"&perms="+perms); + top.ICEcoder.serverMessage('chMod '+perms+' on
'+file.replace(top.iceRoot,"")); }, // Show a message