BUGFIX: notifying on new topics when topic list is not visible

This commit is contained in:
Sam 2014-02-03 14:50:51 +11:00
parent 6205240a56
commit f7bf4b2dc3
2 changed files with 11 additions and 1 deletions

View File

@ -54,7 +54,9 @@ Discourse.DiscoveryTopicsController = Discourse.DiscoveryController.extend({
daily: Em.computed.equal('period', 'daily'),
updateTitle: function(){
Discourse.notifyTitle(this.get('topicTrackingState.incomingCount'));
if(this.get('enableTitleUpdate')) {
Discourse.notifyTitle(this.get('topicTrackingState.incomingCount'));
}
}.observes('topicTrackingState.incomingCount'),
footerMessage: function() {

View File

@ -31,6 +31,14 @@ Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.LoadMore, {
}
},
didInsertElement: function() {
this.set('controller.enableTitleUpdate', true);
},
willDestroyElement: function() {
this.set('controller.enableTitleUpdate', false);
},
// Remember where we were scrolled to
saveScrollPosition: function() {
Discourse.Session.current().set('topicListScrollPosition', $(window).scrollTop());