mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-13 11:58:46 +01:00
Don't switch tab if closing another tab
This commit is contained in:
@@ -39,6 +39,7 @@ var ICEcoder = {
|
||||
draggingTab: false, // If we're dragging a tab
|
||||
draggingWithKey: false, // The key that's down while dragging, false if no key
|
||||
tabLeftPos: [], // Array of left positions of tabs inside content area
|
||||
overCloseLink: false, // If mouse is over close link on tab or not
|
||||
colorCurrentBG: '#1d1d1b', // Current tab/file background color
|
||||
colorCurrentText: '#fff', // Current tab/file text color
|
||||
colorOpenBG: '#c3c3c3', // Open tab/file background color
|
||||
@@ -4175,7 +4176,7 @@ var ICEcoder = {
|
||||
this.openFiles.push(shortURL);
|
||||
|
||||
// Setup a new tab
|
||||
closeTabLink = '<a nohref onClick="ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3), 10))"><img src="' + this.iceLoc + '/assets/images/nav-close.gif" class="closeTab" onMouseOver="prevBG = this.style.backgroundColor; this.style.backgroundColor = \'#333\'; this.overCloseLink = true" onMouseOut="this.style.backgroundColor = prevBG; this.overCloseLink = false"></a>';
|
||||
closeTabLink = '<a nohref onClick="ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3), 10))"><img src="' + this.iceLoc + '/assets/images/nav-close.gif" class="closeTab" onMouseOver="prevBG = this.style.backgroundColor; this.style.backgroundColor = \'#333\'; parent.ICEcoder.overCloseLink = true" onMouseOut="this.style.backgroundColor = prevBG; parent.ICEcoder.overCloseLink = false"></a>';
|
||||
get('tab' + (this.openFiles.length)).style.display = "inline-block";
|
||||
fileName = this.openFiles[this.openFiles.length - 1];
|
||||
fileExt = fileName.substr(fileName.lastIndexOf(".") + 1);
|
||||
@@ -4223,7 +4224,7 @@ var ICEcoder = {
|
||||
this.openFiles[tabNum - 1] = newName;
|
||||
|
||||
// Setup a new tab
|
||||
closeTabLink = '<a nohref onClick="ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3), 10))"><img src="' + this.iceLoc + '/assets/images/nav-close.gif" class="closeTab" onMouseOver="prevBG = this.style.backgroundColor; this.style.backgroundColor = \'#333\'; this.overCloseLink = true" onMouseOut="this.style.backgroundColor = prevBG; this.overCloseLink = false"></a>';
|
||||
closeTabLink = '<a nohref onClick="ICEcoder.closeTab(parseInt(this.parentNode.id.slice(3), 10))"><img src="' + this.iceLoc + '/assets/images/nav-close.gif" class="closeTab" onMouseOver="prevBG = this.style.backgroundColor; this.style.backgroundColor = \'#333\'; parent.ICEcoder.overCloseLink = true" onMouseOut="this.style.backgroundColor = prevBG; parent.ICEcoder.overCloseLink = false"></a>';
|
||||
fileName = this.openFiles[tabNum - 1];
|
||||
fileExt = fileName.substr(fileName.lastIndexOf(".") + 1);
|
||||
get('tab' + tabNum).innerHTML = closeTabLink + "<span style=\"display: inline-block; width: 19px\"></span>" + fileName.slice(fileName.lastIndexOf("/")).replace(/\//, "");
|
||||
|
||||
@@ -312,7 +312,7 @@ if (true === $havePrettier && true === file_exists(dirname(__FILE__) . "/plugins
|
||||
<a nohref onClick="ICEcoder.alphaTabs()"><img src="<?php echo $iceURLPath;?>/assets/images/nav-alpha.png" class="alphaTabs" title="<?php echo $t['Alphabetize tabs'];?>"></a>
|
||||
<?php
|
||||
for ($i = 1; $i <= 100; $i++) {
|
||||
echo '<div id="tab' . $i . '" class="tab" onmousedown="ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3), 10)) : ICEcoder.canSwitchTabs = true; thisColor = ICEcoder.colorSelectedText; if (!ICEcoder.overCloseLink) {ICEcoder.tabDragStart(parseInt(this.id.slice(3), 10))}; if (event.button == 1) {ICEcoder.closeTab(parseInt(this.id.slice(3), 10)); return false};" onmouseover="thisColor = this.style.color; this.style.color = ICEcoder.colorSelectedText" onmouseout="this.style.color = thisColor"></div>';
|
||||
echo '<div id="tab' . $i . '" class="tab" onmousedown="!ICEcoder.overCloseLink && ICEcoder.canSwitchTabs ? ICEcoder.switchTab(parseInt(this.id.slice(3), 10)) : ICEcoder.canSwitchTabs = true; thisColor = ICEcoder.colorSelectedText; if (!ICEcoder.overCloseLink) {ICEcoder.tabDragStart(parseInt(this.id.slice(3), 10))}; if (event.button == 1) {ICEcoder.closeTab(parseInt(this.id.slice(3), 10)); return false};" onmouseover="thisColor = this.style.color; this.style.color = ICEcoder.colorSelectedText" onmouseout="this.style.color = thisColor"></div>';
|
||||
}
|
||||
?><div class="newTab" onClick="ICEcoder.newTab(false)" id="newTab">+</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user