mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 03:09:00 +08:00
only update title if it changes
This commit is contained in:
parent
a48fb956f0
commit
4b54e10d27
|
@ -39,11 +39,14 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
if (notifyCount > 0 && !Discourse.User.currentProp('dynamic_favicon')) {
|
||||
title = "(" + notifyCount + ") " + title;
|
||||
}
|
||||
// chrome bug workaround see: http://stackoverflow.com/questions/2952384/changing-the-window-title-when-focussing-the-window-doesnt-work-in-chrome
|
||||
window.setTimeout(function() {
|
||||
document.title = ".";
|
||||
document.title = title;
|
||||
}, 200);
|
||||
|
||||
if(title !== document.title) {
|
||||
// chrome bug workaround see: http://stackoverflow.com/questions/2952384/changing-the-window-title-when-focussing-the-window-doesnt-work-in-chrome
|
||||
window.setTimeout(function() {
|
||||
document.title = ".";
|
||||
document.title = title;
|
||||
}, 200);
|
||||
}
|
||||
}.observes('title', 'hasFocus', 'notifyCount'),
|
||||
|
||||
faviconChanged: function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user