From 880f3072ea98afa4f992372e71cc127db063ab49 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 23 Jun 2015 10:27:42 +0930 Subject: [PATCH] Only show reply list if there are replies not adjacent --- extensions/mentions/js/src/mentioned-by-list.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/mentions/js/src/mentioned-by-list.js b/extensions/mentions/js/src/mentioned-by-list.js index d7666335b..22f23c40d 100644 --- a/extensions/mentions/js/src/mentioned-by-list.js +++ b/extensions/mentions/js/src/mentioned-by-list.js @@ -15,9 +15,16 @@ export default function mentionedByList() { }); extend(CommentPost.prototype, 'footerItems', function(items) { - var replies = this.props.post.mentionedBy(); + var post = this.props.post; + var replies = post.mentionedBy(); if (replies && replies.length) { + // If there is only one reply, and it's adjacent to this post, we don't + // really need to show the list. + if (replies.length === 1 && replies[0].number() == post.number() + 1) { + return; + } + var hidePreview = () => { this.$('.mentioned-by-preview').removeClass('in').one('transitionend', function() { $(this).hide(); }); };