mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:49:14 +08:00
FEATURE: Add title notification to topics
This commit is contained in:
parent
330a5e80cd
commit
da23735062
|
@ -78,6 +78,20 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
|||
this.set('notifyCount', count);
|
||||
},
|
||||
|
||||
notifyBackgroundCountIncrement: function() {
|
||||
if (!this.get('hasFocus')) {
|
||||
this.set('backgroundNotify', true);
|
||||
this.set('notifyCount', (this.get('notifyCount') || 0) + 1);
|
||||
}
|
||||
},
|
||||
|
||||
resetBackgroundNotifyCount: function() {
|
||||
if (this.get('hasFocus') && this.get('backgroundNotify')) {
|
||||
this.set('notifyCount', 0);
|
||||
}
|
||||
this.set('backgroundNotify', false);
|
||||
}.observes('hasFocus'),
|
||||
|
||||
authenticationComplete: function(options) {
|
||||
// TODO, how to dispatch this to the controller without the container?
|
||||
var loginController = Discourse.__container__.lookup('controller:login');
|
||||
|
|
|
@ -594,6 +594,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
}
|
||||
case "created": {
|
||||
postStream.triggerNewPostInStream(data.id);
|
||||
Discourse.notifyBackgroundCountIncrement();
|
||||
return;
|
||||
}
|
||||
default: {
|
||||
|
|
Loading…
Reference in New Issue
Block a user