Deselect file we're closing in the file manager

This commit is contained in:
Matt Pass
2012-09-27 18:07:11 +01:00
parent 7e773e5d0a
commit 6df5adf0f1

View File

@@ -572,7 +572,7 @@ var ICEcoder = {
// Close the tab upon request
closeTab: function(closeTabNum) {
var cM, okToRemove;
var cM, okToRemove, closeFileName;
cM = ICEcoder.getcMInstance();
okToRemove = true;
@@ -581,6 +581,9 @@ var ICEcoder = {
}
if (okToRemove) {
// Get the filename of tab we're closing
closeFileName = top.ICEcoder.openFiles[closeTabNum-1];
// recursively copy over all tabs & data from the tab to the right, if there is one
for (var i=closeTabNum;i<ICEcoder.openFiles.length;i++) {
top.document.getElementById('tab'+i).innerHTML = top.document.getElementById('tab'+(i+1)).innerHTML;
@@ -615,6 +618,9 @@ var ICEcoder = {
top.ICEcoder.changedContent.splice(closeTabNum-1,1);
top.parent.ICEcoder.redoTabHighlight(ICEcoder.selectedTab);
// Remove any highlighting from the file manager
top.ICEcoder.selectDeselectFile('deselect',top.ICEcoder.filesFrame.contentWindow.document.getElementById(closeFileName.replace(/\//g,"|")));
top.ICEcoder.setPreviousFiles();
}
// Lastly, stop it from trying to also switch tab