Skip to content

Commit

Permalink
Adjust document.title Update indicator.
Browse files Browse the repository at this point in the history
  • Loading branch information
NI committed Oct 1, 2019
1 parent 5e32228 commit 55a1574
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,14 +306,15 @@ function startApp(rootEl) {
this.changeTitleInfo("(" + tabs.length + (updated ? "*" : "") + ")");
},
tabOpened(tabs) {
if (this.tabUpdateIndicator) {
clearTimeout(this.tabUpdateIndicator);
this.tabUpdateIndicator = null;
}

this.updateTabTitleInfo(tabs, false);
this.tabUpdated(tabs);
},
tabClosed(tabs) {
if (tabs.length > 0) {
this.updateTabTitleInfo(tabs, this.tabUpdateIndicator !== null);

return;
}

if (this.tabUpdateIndicator) {
clearTimeout(this.tabUpdateIndicator);
this.tabUpdateIndicator = null;
Expand All @@ -330,6 +331,7 @@ function startApp(rootEl) {
this.updateTabTitleInfo(tabs, true);

this.tabUpdateIndicator = setTimeout(() => {
this.tabUpdateIndicator = null;
this.updateTabTitleInfo(tabs, false);
}, updateIndicatorMaxDisplayTime);
}
Expand Down

0 comments on commit 55a1574

Please sign in to comment.