Only allow none guests to access the context menu

This commit is contained in:
wmwragg 2016-07-27 11:58:40 +01:00
parent 4b26ac58af
commit 6d141d1a7b

View file

@ -67,7 +67,10 @@ module.exports = React.createClass({
},
badgeOnMouseEnter: function() {
// Only allow none guests to access the context menu
if (!MatrixClientPeg.get().isGuest()) {
this.setState( { badgeHover : true } );
}
},
badgeOnMouseLeave: function() {
@ -75,6 +78,8 @@ module.exports = React.createClass({
},
onBadgeClicked: function(e) {
// Only allow none guests to access the context menu
if (!MatrixClientPeg.get().isGuest()) {
var Menu = sdk.getComponent('context_menus.NotificationStateContextMenu');
var elementRect = e.target.getBoundingClientRect();
// The window X and Y offsets are to adjust position when zoomed in to page
@ -90,6 +95,7 @@ module.exports = React.createClass({
}
});
this.setState({ menu: true });
}
},
render: function() {