From 8fa96e19d562666410786ee7cfa506463693ea88 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sat, 16 Jun 2018 09:07:16 +0100 Subject: [PATCH] allow rightclicking for exposing room tile context menus Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/groups/GroupInviteTile.js | 16 +++++++++++++--- src/components/views/rooms/RoomTile.js | 17 ++++++++++++++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/components/views/groups/GroupInviteTile.js b/src/components/views/groups/GroupInviteTile.js index 4d5f3c6f3a..fff9aafac1 100644 --- a/src/components/views/groups/GroupInviteTile.js +++ b/src/components/views/groups/GroupInviteTile.js @@ -66,6 +66,11 @@ export default React.createClass({ }); }, + onContextMenu: function(e) { + this.onBadgeClicked(e); + e.preventDefault(); + }, + onBadgeClicked: function(e) { // Prevent the RoomTile onClick event firing as well e.stopPropagation(); @@ -79,7 +84,7 @@ export default React.createClass({ } const RoomTileContextMenu = sdk.getComponent('context_menus.GroupInviteTileContextMenu'); - const elementRect = e.target.getBoundingClientRect(); + const elementRect = this.refs.badge.getBoundingClientRect(); // The window X and Y offsets are to adjust position when zoomed in to page const x = elementRect.right + window.pageXOffset + 3; @@ -125,7 +130,7 @@ export default React.createClass({ }); const badgeContent = badgeEllipsis ? '\u00B7\u00B7\u00B7' : '!'; - const badge =