Adjust document.title Update indicator.

This commit is contained in:
NI
2019-10-01 15:46:18 +08:00
parent 5e32228960
commit 55a1574f46

View File

@@ -306,14 +306,15 @@ function startApp(rootEl) {
this.changeTitleInfo("(" + tabs.length + (updated ? "*" : "") + ")"); this.changeTitleInfo("(" + tabs.length + (updated ? "*" : "") + ")");
}, },
tabOpened(tabs) { tabOpened(tabs) {
if (this.tabUpdateIndicator) { this.tabUpdated(tabs);
clearTimeout(this.tabUpdateIndicator);
this.tabUpdateIndicator = null;
}
this.updateTabTitleInfo(tabs, false);
}, },
tabClosed(tabs) { tabClosed(tabs) {
if (tabs.length > 0) {
this.updateTabTitleInfo(tabs, this.tabUpdateIndicator !== null);
return;
}
if (this.tabUpdateIndicator) { if (this.tabUpdateIndicator) {
clearTimeout(this.tabUpdateIndicator); clearTimeout(this.tabUpdateIndicator);
this.tabUpdateIndicator = null; this.tabUpdateIndicator = null;
@@ -330,6 +331,7 @@ function startApp(rootEl) {
this.updateTabTitleInfo(tabs, true); this.updateTabTitleInfo(tabs, true);
this.tabUpdateIndicator = setTimeout(() => { this.tabUpdateIndicator = setTimeout(() => {
this.tabUpdateIndicator = null;
this.updateTabTitleInfo(tabs, false); this.updateTabTitleInfo(tabs, false);
}, updateIndicatorMaxDisplayTime); }, updateIndicatorMaxDisplayTime);
} }