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
This commit is contained in:
Matt Pass
2012-09-21 14:22:14 +01:00
parent 6c004c3010
commit c3dbc4187f

View File

@@ -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('<b>chMod '+perms+' on </b><br>'+file);
top.ICEcoder.serverQueue("add","lib/file-control.php?action=perms&file="+file.replace(top.iceRoot,"")+"&perms="+perms);
top.ICEcoder.serverMessage('<b>chMod '+perms+' on </b><br>'+file.replace(top.iceRoot,""));
},
// Show a message