mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
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?
|
// Is the reply to a post directly below it?
|
||||||
isReplyDirectlyBelow: function(post) {
|
isReplyDirectlyBelow: function(post) {
|
||||||
var posts = this.get('postStream.posts');
|
var posts = this.get('postStream.posts');
|
||||||
|
var postNumber = post.get('post_number');
|
||||||
if (!posts) return;
|
if (!posts) return;
|
||||||
|
|
||||||
var postBelow = posts[posts.indexOf(post) + 1];
|
var postBelow = posts[posts.indexOf(post) + 1];
|
||||||
|
|
||||||
// If the post directly below's reply_to_post_number is our post number, it's
|
// If the post directly below's reply_to_post_number is our post number or we are quoted,
|
||||||
// considered directly below.
|
// it's considered directly below.
|
||||||
return postBelow && postBelow.get('reply_to_post_number') === post.get('post_number');
|
//
|
||||||
|
// 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'),
|
excerptNotEmpty: Em.computed.notEmpty('excerpt'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user