From 7f05f8ab22db8a9dedf555a65f0463a0566dc3f6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 28 Jul 2015 17:59:00 +0930 Subject: [PATCH] Fix post mention preview behaviour on mobile --- extensions/mentions/js/forum/src/addPostMentionPreviews.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/mentions/js/forum/src/addPostMentionPreviews.js b/extensions/mentions/js/forum/src/addPostMentionPreviews.js index ccd486e38..c51e40408 100644 --- a/extensions/mentions/js/forum/src/addPostMentionPreviews.js +++ b/extensions/mentions/js/forum/src/addPostMentionPreviews.js @@ -13,7 +13,7 @@ export default function addPostMentionPreviews() { const discussion = this.props.post.discussion(); - this.$('.UserMention').each(function() { + this.$('.UserMention, .PostMention').each(function() { m.route.call(this, this, false, {}, {attrs: {href: this.getAttribute('href')}}); }); @@ -51,7 +51,7 @@ export default function addPostMentionPreviews() { // hasn't yet been loaded, we will need to do that. if (!visible) { // Position the preview so that it appears above the mention. - // (The offsetParent should be .post-body.) + // (The offsetParent should be .Post-body.) const positionPreview = () => { $preview.show().css('top', $this.offset().top - $this.offsetParent().offset().top - $preview.outerHeight(true)); }; @@ -94,7 +94,7 @@ export default function addPostMentionPreviews() { timeout = setTimeout(hidePreview, 250); } ) - .on('click', e => e.preventDefault()) + .on('touchstart', e => e.preventDefault()) .on('touchend', e => { showPreview(); e.stopPropagation();