mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user