1
0
mirror of https://github.com/flarum/core.git synced 2025-07-29 20:50:28 +02:00

Only show reply list if there are replies not adjacent

This commit is contained in:
Toby Zerner
2015-06-23 10:27:42 +09:30
parent 8bdbdeb433
commit 880f3072ea

View File

@@ -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(); });
};