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 =
{ badgeContent }
;
+ const badge = { badgeContent }
;
let tooltip;
if (this.props.collapsed && this.state.hover) {
@@ -139,7 +144,12 @@ export default React.createClass({
});
return (
-
+
{ av }
diff --git a/src/components/views/rooms/RoomTile.js b/src/components/views/rooms/RoomTile.js
index 11eb2090f2..1a9e404012 100644
--- a/src/components/views/rooms/RoomTile.js
+++ b/src/components/views/rooms/RoomTile.js
@@ -187,6 +187,11 @@ module.exports = React.createClass({
this.badgeOnMouseLeave();
},
+ onContextMenu: function(e) {
+ this.onBadgeClicked(e);
+ e.preventDefault();
+ },
+
badgeOnMouseEnter: function() {
// Only allow non-guests to access the context menu
// and only change it if it needs to change
@@ -208,7 +213,7 @@ module.exports = React.createClass({
}
const RoomTileContextMenu = sdk.getComponent('context_menus.RoomTileContextMenu');
- 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;
@@ -280,7 +285,7 @@ module.exports = React.createClass({
badgeContent = '\u200B';
}
- badge = { badgeContent }
;
+ badge = { badgeContent }
;
const EmojiText = sdk.getComponent('elements.EmojiText');
let label;
@@ -317,7 +322,13 @@ module.exports = React.createClass({
directMessageIndicator = ;
}
- return
+ return