FIX: Post count progress was a little off. Minor fix to hidden posts
This commit is contained in:
parent
5280e279f7
commit
744add9ece
|
@ -275,9 +275,9 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
|
|||
streamPercentage: function() {
|
||||
if (!this.get('postStream.loaded')) { return 0; }
|
||||
if (this.get('postStream.highest_post_number') === 0) { return 0; }
|
||||
var perc = this.get('progressPosition') / this.get('highest_post_number');
|
||||
var perc = this.get('progressPosition') / this.get('filteredPostsCount');
|
||||
return (perc > 1.0) ? 1.0 : perc;
|
||||
}.property('postStream.loaded', 'progressPosition', 'highest_post_number'),
|
||||
}.property('postStream.loaded', 'progressPosition', 'filteredPostsCount'),
|
||||
|
||||
multiSelectChanged: function() {
|
||||
// Deselect all posts when multi select is turned off
|
||||
|
|
|
@ -11,7 +11,7 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, {
|
|||
templateName: 'post',
|
||||
classNameBindings: ['postTypeClass',
|
||||
'selected',
|
||||
'post.hidden:hidden',
|
||||
'post.hidden:deleted',
|
||||
'post.deleted'],
|
||||
postBinding: 'content',
|
||||
|
||||
|
|
|
@ -264,7 +264,8 @@ class TopicView
|
|||
end
|
||||
|
||||
def unfiltered_posts
|
||||
result = @topic.posts.where(hidden: false)
|
||||
result = @topic.posts
|
||||
result = result.where(hidden: false) unless @user.try(:staff?)
|
||||
result = result.with_deleted if @user.try(:staff?)
|
||||
result
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue