openFiles array fixes

renameTab now targets the right array position (tabNum-1)
updateFileManager now adds a / in to the files path ref
This commit is contained in:
Matt Pass
2012-08-02 07:40:58 +01:00
parent 3dc7c62559
commit 81fc8495b2

View File

@@ -444,11 +444,11 @@ var ICEcoder = {
var closeTabLink;
// Push new file into array
top.ICEcoder.openFiles[tabNum] = newName;
top.ICEcoder.openFiles[tabNum-1] = newName;
// Setup a new tab
closeTabLink = '<a nohref onClick="parent.ICEcoder.closeTab('+tabNum+')"><img src="images/nav-close.gif" id="closeTabButton'+tabNum+'" class="closeTab" onMouseOver="prevBG=this.style.backgroundColor;this.style.backgroundColor=\'#333\'" onMouseOut="this.style.backgroundColor=prevBG"></a>';
top.document.getElementById('tab'+tabNum).innerHTML = top.ICEcoder.openFiles[tabNum] + " " + closeTabLink;
top.document.getElementById('tab'+tabNum).innerHTML = top.ICEcoder.openFiles[tabNum-1] + " " + closeTabLink;
},
// Indicate if the nesting structure of the code is OK
@@ -744,7 +744,6 @@ var ICEcoder = {
// No reason why we can't open a file (so far)
canOpenFile = true;
// Limit to 10 files open at a time
if (top.ICEcoder.openFiles.length<10) {
// check if we've already got it in our array
@@ -1205,7 +1204,7 @@ 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]=location+"/"+file;
top.ICEcoder.openFiles[top.ICEcoder.selectedTab-1]=location+file;
}
}