Extend 10 tabs to 100 tabs

10 tabs can sometimes be too few no one should ideally need more than
100 tabs open so this is a good new level.
Doesn't appear to impact on DOM or JS at all, especially as I don't need
to rework code to move to an unlimited tabs setup instead.
Having a limit also helps save crashing or bogging down the browser.
This commit is contained in:
Matt Pass
2012-11-25 14:18:36 +00:00
parent d96ebe4282
commit 4b17d76144
2 changed files with 5 additions and 5 deletions

View File

@@ -116,7 +116,7 @@ window.onbeforeunload = function() {
<div id="editor" class="editor">
<div id="tabsBar" class="tabsBar" onContextMenu="return false">
<?php
for ($i=1;$i<=10;$i++) {
for ($i=1;$i<=100;$i++) {
echo '<div id="tab'.$i.'" class="tab" draggable="true" onClick="ICEcoder.canSwitchTabs ? ICEcoder.switchTab('.$i.') : ICEcoder.canSwitchTabs=true"></div>';
}
?><div class="newTab" onClick="ICEcoder.newTab()"><img src="images/nav-new.png"></div>

View File

@@ -508,8 +508,8 @@ var ICEcoder = {
shortURL = top.ICEcoder.thisFileFolderLink.replace(/\|/g,"/");
// 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) {
// Limit to 100 files open at a time
if (top.ICEcoder.openFiles.length<100) {
// check if we've already got it in our array
if (top.ICEcoder.openFiles.indexOf(shortURL)>-1 && shortURL!="/[NEW]") {
// we have, so instead, switch to that tab
@@ -517,8 +517,8 @@ var ICEcoder = {
top.ICEcoder.switchTab(i+1);
}
} else {
// show a message because we have 10 files open
top.ICEcoder.message('Sorry, you can only have 10 files open at a time!');
// show a message because we have 100 files open
top.ICEcoder.message('Sorry, you can only have 100 files open at a time!');
canOpenFile = false;
}