Skip to content

Commit

Permalink
Merge pull request RocketChat#168 from shubhsherl/fix_msg_action
Browse files Browse the repository at this point in the history
fix message action menu for touch
  • Loading branch information
ear-dev committed Feb 26, 2020
2 parents 89559c4 + b265310 commit 4dbb73f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
modal,
Layout,
MessageAction,
MessageTypes,
RocketChatTabBar,
} from '../../../../ui-utils';
import { messageContext } from '../../../../ui-utils/client/lib/messageContext';
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
},
Expand Down

0 comments on commit 4dbb73f

Please sign in to comment.