diff --git a/src/components/views/rooms/NotificationStateContextMenu.js b/src/components/views/rooms/NotificationStateContextMenu.js index 3d125d2c..d8a79b30 100644 --- a/src/components/views/rooms/NotificationStateContextMenu.js +++ b/src/components/views/rooms/NotificationStateContextMenu.js @@ -18,6 +18,7 @@ limitations under the License. var q = require("q"); var React = require('react'); +var classNames = require('classnames'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); module.exports = React.createClass({ @@ -67,31 +68,52 @@ module.exports = React.createClass({ _onToggle: function(ev) { switch (ev.target.value) { case "all": - if (this.props.onFinished) { - this._save(false); - this.props.onFinished(); - } + this._save(false); break; case "mute": - if (this.props.onFinished) { - this._save(true); - this.props.onFinished(); - } + this._save(true); break; } + + if (this.props.onFinished) { + this.props.onFinished(); + }; + }, + + _onClickAllNotifs: function() { + this._save(false); + if (this.props.onFinished) { + this.props.onFinished(); + }; + }, + + _onClickMute: function() { + this._save(true); + if (this.props.onFinished) { + this.props.onFinished(); + }; }, render: function() { var cli = MatrixClientPeg.get(); + + var allNotifsClasses = classNames({ + 'mx_ContextualMenu_field': true, + 'mx_ContextualMenu_fieldSet': !this.state.areNotifsMuted, + }); + + var muteNotifsClasses = classNames({ + 'mx_ContextualMenu_field': true, + 'mx_ContextualMenu_fieldSet': this.state.areNotifsMuted, + }); + return (