* improve UI of tabsbar in index.

This commit is contained in:
Catouse
2020-12-29 09:25:25 +08:00
parent 9e0628e295
commit 65f114b500
+4 -12
View File
@@ -139,7 +139,7 @@
for(var group in openedTabs)
{
var tab = openedTabs[group];
if((!onlyShowed || tab.show) && lastShowIndex < tab.zIndex)
if((!onlyShowed || tab.show) && lastShowIndex < tab.zIndex && !tab.closed)
{
lastShowIndex = tab.zIndex;
lastTab = tab;
@@ -198,6 +198,7 @@
var tab = openedTabs[group];
if(!tab) return;
tab.closed = true;
hideTab(group);
tab.$page.remove();
tab.$bar.remove();
@@ -298,19 +299,10 @@
/* Redirect or open default tab after document load */
var defaultOpenUrl = window.defaultOpen;
if(!defaultOpenUrl)
if(!defaultOpenUrl && location.hash.indexOf('#open=') === 0)
{
if(location.hash.indexOf('#open=') === 0)
{
defaultOpenUrl = decodeURIComponent(location.hash.substr(6));
}
if(!defaultOpenUrl)
{
defaultOpenUrl = $.cookie('open-in-tab');
if(defaultOpenUrl) $.cookie('open-in-tab', null);
}
defaultOpenUrl = decodeURIComponent(location.hash.substr(6));
}
if(defaultOpenUrl) openTab(defaultOpenUrl);
else openTab(defaultTabGroup);
});