From 3e596aaadf99bb0ee793665eb8417f740782de49 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Wed, 12 May 2021 20:42:33 +0100 Subject: [PATCH] Move replies preview dropdown out of Post-footer (#55) --- .../js/src/forum/addMentionedByList.js | 114 ++++++++++-------- 1 file changed, 65 insertions(+), 49 deletions(-) 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 = $('