FIX: Title could temporarily revert to the site name
This commit is contained in:
parent
ae2f861101
commit
6c65162b05
|
@ -1,16 +1,9 @@
|
||||||
/*global Favcount:true*/
|
/*global Favcount:true*/
|
||||||
|
|
||||||
/**
|
|
||||||
The main Discourse Application
|
|
||||||
|
|
||||||
@class Discourse
|
|
||||||
@extends Ember.Application
|
|
||||||
**/
|
|
||||||
var DiscourseResolver = require('discourse/ember/resolver').default;
|
var DiscourseResolver = require('discourse/ember/resolver').default;
|
||||||
|
|
||||||
window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||||
rootElement: '#main',
|
rootElement: '#main',
|
||||||
_docTitle: null,
|
_docTitle: document.title,
|
||||||
|
|
||||||
getURL: function(url) {
|
getURL: function(url) {
|
||||||
// If it's a non relative URL, return it.
|
// If it's a non relative URL, return it.
|
||||||
|
@ -46,13 +39,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||||
title = "(" + notifyCount + ") " + title;
|
title = "(" + notifyCount + ") " + title;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title !== document.title) {
|
document.title = 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('_docTitle', 'hasFocus', 'notifyCount'),
|
}.observes('_docTitle', 'hasFocus', 'notifyCount'),
|
||||||
|
|
||||||
faviconChanged: function() {
|
faviconChanged: function() {
|
||||||
|
|
Loading…
Reference in New Issue