mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-11 19:16:49 +01:00
Path fixes, setting new file openFiles value
On adding a new file, need to also set the openFiles array value to match the newly given filename
This commit is contained in:
@@ -1172,7 +1172,7 @@ var ICEcoder = {
|
||||
// Finally we can add the first list item for this file/folder we're adding
|
||||
newLI = document.createElement("li");
|
||||
newLI.className = cssStyle;
|
||||
newLI.innerHTML = '<a href="#" title="'+location+'/'+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+'|'+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+'|'+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+'|'+file+'_perms">'+perms+'</span></a>';
|
||||
newLI.innerHTML = '<a href="#" title="'+location+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+file+'_perms">'+perms+'</span></a>';
|
||||
locNest.nextSibling.appendChild(newLI);
|
||||
locNest.nextSibling.appendChild(newText);
|
||||
|
||||
@@ -1191,7 +1191,7 @@ var ICEcoder = {
|
||||
if ((elemType==actionElemType && nameLI > file) || (actionElemType=="folder" && elemType=="file") || i==locNest.childNodes.length-1) {
|
||||
newLI = document.createElement("li");
|
||||
newLI.className = cssStyle;
|
||||
newLI.innerHTML = '<a href="#" title="'+location+'/'+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+'|'+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+'|'+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+'|'+file+'_perms">'+perms+'</span></a>';
|
||||
newLI.innerHTML = '<a href="#" title="'+location+file+'" onMouseOver="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\''+location.replace(/\//g,"|")+file+'\')" onMouseOut="top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" style="position: relative; left:-22px"> <span id="'+location.replace(/\//g,"|")+file+'">'+file+'</span> <span style="color: #888; font-size: 8px" id="'+location.replace(/\//g,"|")+file+'_perms">'+perms+'</span></a>';
|
||||
// Append or insert depending on which of the above if statements is true
|
||||
i==locNest.childNodes.length-1 ? locNest.appendChild(newLI) : locNest.insertBefore(newLI,locNest.childNodes[i]);
|
||||
i==locNest.childNodes.length-1 ? locNest.appendChild(newText) : locNest.insertBefore(newLI,locNest.childNodes[i+1]);
|
||||
@@ -1202,6 +1202,10 @@ var ICEcoder = {
|
||||
}
|
||||
}
|
||||
}
|
||||
// If we added a new file, we've saved it under a new filename, so set that
|
||||
if (actionElemType=="file") {
|
||||
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]="/"+file;
|
||||
}
|
||||
}
|
||||
|
||||
// Renaming files
|
||||
|
||||
Reference in New Issue
Block a user