mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 00:01:13 +08:00
remove dead code
update title properly when count in list changes remove broken (*) title notification from topic cause its just weird
This commit is contained in:
@ -42,15 +42,17 @@ Discourse = Ember.Application.createWithMixins({
|
||||
}
|
||||
title += Discourse.SiteSettings.title;
|
||||
$('title').text(title);
|
||||
if (!this.get('hasFocus') && this.get('notify')) {
|
||||
title = "(*) " + title;
|
||||
|
||||
var notifyCount = this.get('notifyCount');
|
||||
if (notifyCount > 0) {
|
||||
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);
|
||||
}.observes('title', 'hasFocus', 'notify'),
|
||||
}.observes('title', 'hasFocus', 'notifyCount'),
|
||||
|
||||
// The classes of buttons to show on a post
|
||||
postButtons: function() {
|
||||
@ -59,8 +61,8 @@ Discourse = Ember.Application.createWithMixins({
|
||||
});
|
||||
}.property('Discourse.SiteSettings.post_menu'),
|
||||
|
||||
notifyTitle: function() {
|
||||
this.set('notify', true);
|
||||
notifyTitle: function(count) {
|
||||
this.set('notifyCount', count);
|
||||
},
|
||||
|
||||
openComposer: function(opts) {
|
||||
|
Reference in New Issue
Block a user