diff --git a/extensions/mentions/js/src/forum/addMentionedByList.js b/extensions/mentions/js/src/forum/addMentionedByList.js index 3248a4aad..397c72e71 100644 --- a/extensions/mentions/js/src/forum/addMentionedByList.js +++ b/extensions/mentions/js/src/forum/addMentionedByList.js @@ -11,58 +11,74 @@ import icon from 'flarum/helpers/icon'; export default function addMentionedByList() { Post.prototype.mentionedBy = Model.hasMany('mentionedBy'); + function hidePreview() { + this.$('.Post-mentionedBy-preview') + .removeClass('in') + .one('transitionend', function() { $(this).hide(); }); + } + + extend(CommentPost.prototype, 'oncreate', function() { + let timeout; + const post = this.attrs.post; + const replies = post.mentionedBy(); + + if (replies && replies.length) { + const $preview = $('