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