FEATURE: live delete / recover

BUGFIX: total post count could be smaller than filtered posts count
BUGFIX: filteredPostsCount not correctly defined
This commit is contained in:
Sam
2014-06-04 14:10:34 +10:00
parent e307bad89a
commit cab589ec67
4 changed files with 107 additions and 6 deletions
@@ -265,6 +265,12 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
return (this.get('progressPosition') < 2);
}.property('progressPosition'),
filteredPostCountChanged: function(){
if(this.get('postStream.filteredPostsCount') < this.get('progressPosition')){
this.set('progressPosition', this.get('postStream.filteredPostsCount'));
}
}.observes('postStream.filteredPostsCount'),
jumpBottomDisabled: function() {
return this.get('progressPosition') >= this.get('postStream.filteredPostsCount') ||
this.get('progressPosition') >= this.get('highest_post_number');
@@ -410,6 +416,16 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
return;
}
if (data.type === "deleted"){
postStream.triggerDeletedPost(data.id, data.post_number);
return;
}
if (data.type === "recovered"){
postStream.triggerRecoveredPost(data.id, data.post_number);
return;
}
// Add the new post into the stream
postStream.triggerNewPostInStream(data.id);
});