Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Extend 10 tabs to 100 tabs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mattpass committed Nov 25, 2012
1 parent d96ebe4 commit 4b17d76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -116,7 +116,7 @@
<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>
Expand Down
8 changes: 4 additions & 4 deletions lib/ice-coder.js
Expand Up @@ -508,17 +508,17 @@ 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
canOpenFile = false;
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;
}

Expand Down

0 comments on commit 4b17d76

Please sign in to comment.