From b2653100f3c75e1d1be15c51fba0003777030ae1 Mon Sep 17 00:00:00 2001 From: shubhsherl Date: Mon, 24 Feb 2020 23:09:59 +0530 Subject: [PATCH] fix message action menu for touch --- app/ui/client/views/app/room.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/ui/client/views/app/room.js b/app/ui/client/views/app/room.js index ea71ea3d2e77..f5785c4a4dbb 100644 --- a/app/ui/client/views/app/room.js +++ b/app/ui/client/views/app/room.js @@ -23,6 +23,7 @@ import { modal, Layout, MessageAction, + MessageTypes, RocketChatTabBar, } from '../../../../ui-utils'; import { messageContext } from '../../../../ui-utils/client/lib/messageContext'; @@ -89,6 +90,11 @@ const openProfileTabOrOpenDM = (e, instance, username) => { e.stopPropagation(); }; +const showMessageActions = (e, outerContext) => { + const { msg } = messageArgs(outerContext); + return e.target && e.target.nodeName === 'DIV' && !msg.private && !MessageTypes.isSystemMessage(msg); +}; + const mountPopover = (e, i, outerContext) => { let context = $(e.target).parents('.message').data('context'); if (!context) { @@ -671,9 +677,7 @@ Template.room.events({ } window.open(e.target.href); - } - - if (isMobile() && !touchMoved) { + } else if (isMobile() && !touchMoved && showMessageActions(e, this)) { mountPopover(e, t, this); } },