diff --git a/lib/ice-coder.js b/lib/ice-coder.js index e4ef236..278d1cf 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1890,6 +1890,9 @@ var ICEcoder = { closeTab: function(closeTabNum, dontSetPV, dontAsk) { var cM, okToRemove, closeFileName; + // If we haven't specified, close current tab + if (!closeTabNum) {closeTabNum = top.ICEcoder.selectedTab}; + cM = ICEcoder.getcMInstance(); okToRemove = true; if (!dontAsk && ICEcoder.changedContent[closeTabNum-1]==1) { diff --git a/lib/ice-coder.min.js b/lib/ice-coder.min.js index e7537b2..4df78d3 100644 --- a/lib/ice-coder.min.js +++ b/lib/ice-coder.min.js @@ -87,9 +87,9 @@ a.slice(a.lastIndexOf("/")).replace(/\//,"");top.get("tab"+top.ICEcoder.openFile 1:1,"noFocus")},previousTab:function(){top.ICEcoder.switchTab(1<=top.ICEcoder.selectedTab-1?top.ICEcoder.selectedTab-1:top.ICEcoder.openFiles.length,"noFocus")},renameTab:function(a,b){var c;top.ICEcoder.openFiles[a-1]=b;c=top.ICEcoder.openFiles[a-1];top.get("tab"+a).innerHTML=' '+ c.slice(c.lastIndexOf("/")).replace(/\//,"");top.get("tab"+a).title="/"+top.ICEcoder.openFiles[a-1].replace(/\//,"")},redoTabHighlight:function(a){for(var b,c,d=1;d<=ICEcoder.changedContent.length;d++){document.getElementById("tab"+d).childNodes[0]&&(document.getElementById("tab"+d).childNodes[0].childNodes[0].style.backgroundColor=1==ICEcoder.changedContent[d-1]?"#b00":"transparent");b=d==a?top.ICEcoder.tabFGselected:top.ICEcoder.tabFGnormalTab;if("undefined"!=typeof top.ICEcoder.openFiles[d-1]&& "/[NEW]"!=top.ICEcoder.openFiles[d-1]&&(c=top.ICEcoder.filesFrame.contentWindow.document.getElementById(top.ICEcoder.openFiles[d-1].replace(/\//g,"|"))))c.style.backgroundColor=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen,c.style.color=d==a?top.ICEcoder.tabFGcurrent:top.ICEcoder.tabFGopenFile;document.getElementById("tab"+d).style.color=b;document.getElementById("tab"+d).style.background=d==a?top.ICEcoder.tabBGcurrent:top.ICEcoder.tabBGopen}top.ICEcoder.fMIconVis("fMSave",1==ICEcoder.changedContent[a- -1]?1:0.3)},closeTab:function(a,b,c){var d;ICEcoder.getcMInstance();d=!0;!c&&1==ICEcoder.changedContent[a-1]&&(d=top.ICEcoder.ask("You have made changes.\n\nAre you sure you want to close without saving?"));if(d){c=top.ICEcoder.openFiles[a-1];for(d=a;db?parseInt(c*g,10)-parseInt(c*(g-1),10):150,e=0==g?41:parseInt(top.get("tab"+g).style.left,10),f=0==g?0:parseInt(top.get("tab"+g).style.width,10)+18,a?d=-18:(top.get("tab"+(g+1)).style.left=e+f+"px",top.get("tab"+(g+1)).style.width=d+"px"),top.ICEcoder.tabLeftPos.push(e+f);top.get("newTab").style.left=e+f+d+18+"px"}},tabDragStart:function(a){top.ICEcoder.draggingTab=a;top.ICEcoder.diffStartX=top.ICEcoder.mouseX;top.ICEcoder.tabDragMouseXStart=(top.ICEcoder.mouseX- (parseInt(top.ICEcoder.files.style.width,10)+41+18))%150;top.get("tab"+a).style.zIndex=2;for(var b=1;b<=top.ICEcoder.openFiles.length;b++)top.get("tab"+b).className=b!==a?"tab tabSlide":"tab tabDrag"},tabDragMove:function(){var a,b;a=parseInt(top.get("tab"+top.ICEcoder.openFiles.length).style.width,10)+18;top.ICEcoder.thisLeft=a=41<=top.ICEcoder.tabDragMouseX?top.ICEcoder.tabDragMouseX<=parseInt(top.get("newTab").style.left,10)-a?top.ICEcoder.tabDragMouseX:parseInt(top.get("newTab").style.left,10)-