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:
Matt Pass
2012-07-30 17:28:27 +01:00
parent 4fe333e335
commit aae759c901

View File

@@ -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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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