diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 4b6947e..2274013 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -1829,17 +1829,17 @@ var ICEcoder = { // Set the tabs width setTabWidths: function() { - var availWidth, avgWidth, lastLeft, lastWidth, thisWidth, tabWidth; + var availWidth, avgWidth, lastLeft, lastWidth, tabWidth; availWidth = parseInt(top.ICEcoder.content.style.width,10)-41-24-10; // - left margin - new tab - right margin avgWidth = (availWidth/top.ICEcoder.openFiles.length)-18; + tabWidth = -18; // Incl 18px offset lastLeft = 41; lastWidth = 0; top.ICEcoder.tabLeftPos = []; for (var i=0;i availWidth ? thisWidth : 150; + tabWidth = top.ICEcoder.openFiles.length*(150+18) > availWidth ? parseInt(avgWidth*i,10) - parseInt(avgWidth*(i-1),10) : 150; lastLeft = i==0 ? 41 : parseInt(top.document.getElementById('tab'+(i)).style.left,10); lastWidth = i==0 ? 0 : parseInt(top.document.getElementById('tab'+(i)).style.width,10)+18; top.document.getElementById('tab'+(i+1)).style.left = (lastLeft+lastWidth) + "px";