HACK: suppress "1 reply" when directly below for quotes posts
This commit is contained in:
parent
f331855482
commit
c412d74369
|
@ -293,13 +293,21 @@ Discourse.Topic = Discourse.Model.extend({
|
|||
// Is the reply to a post directly below it?
|
||||
isReplyDirectlyBelow: function(post) {
|
||||
var posts = this.get('postStream.posts');
|
||||
var postNumber = post.get('post_number');
|
||||
if (!posts) return;
|
||||
|
||||
var postBelow = posts[posts.indexOf(post) + 1];
|
||||
|
||||
// If the post directly below's reply_to_post_number is our post number, it's
|
||||
// considered directly below.
|
||||
return postBelow && postBelow.get('reply_to_post_number') === post.get('post_number');
|
||||
// If the post directly below's reply_to_post_number is our post number or we are quoted,
|
||||
// it's considered directly below.
|
||||
//
|
||||
// TODO: we don't carry information about quoting, this leaves this code fairly fragile
|
||||
// instead we should start shipping quote meta data with posts, but this will add at least
|
||||
// 1 query to the topics page
|
||||
//
|
||||
return postBelow && (postBelow.get('reply_to_post_number') === postNumber ||
|
||||
postBelow.get('cooked').indexOf('data-post="'+ postNumber + '"') >= 0
|
||||
);
|
||||
},
|
||||
|
||||
excerptNotEmpty: Em.computed.notEmpty('excerpt'),
|
||||
|
|
Loading…
Reference in New Issue