FIX: Title could temporarily revert to the site name

This commit is contained in:
Robin Ward 2015-02-12 12:27:51 -05:00
parent ae2f861101
commit 6c65162b05
1 changed files with 2 additions and 15 deletions

View File

@ -1,16 +1,9 @@
/*global Favcount:true*/
/**
The main Discourse Application
@class Discourse
@extends Ember.Application
**/
var DiscourseResolver = require('discourse/ember/resolver').default;
window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
rootElement: '#main',
_docTitle: null,
_docTitle: document.title,
getURL: function(url) {
// If it's a non relative URL, return it.
@ -46,13 +39,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
title = "(" + notifyCount + ") " + title;
}
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);
}
document.title = title;
}.observes('_docTitle', 'hasFocus', 'notifyCount'),
faviconChanged: function() {