Merge pull request #2096 from matrix-org/dbkr/click_on_side_panels_closes_settings_3

Make clicking on side panels close settings (mk 3)
This commit is contained in:
Michael Telatynski 2018-07-29 19:44:53 +01:00 committed by GitHub
commit 2bc4dcc7da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,16 +259,16 @@ const LoggedInView = React.createClass({
// When the panels are disabled, clicking on them results in a mouse event // When the panels are disabled, clicking on them results in a mouse event
// which bubbles to certain elements in the tree. When this happens, close // which bubbles to certain elements in the tree. When this happens, close
// any settings page that is currently open (user/room/group). // any settings page that is currently open (user/room/group).
if (this.props.leftDisabled && if (this.props.leftDisabled && this.props.rightDisabled) {
this.props.rightDisabled && const targetClasses = new Set(ev.target.className.split(' '));
( if (
ev.target.className === 'mx_MatrixChat' || targetClasses.has('mx_MatrixChat') ||
ev.target.className === 'mx_MatrixChat_middlePanel' || targetClasses.has('mx_MatrixChat_middlePanel') ||
ev.target.className === 'mx_RoomView' targetClasses.has('mx_RoomView')
)
) { ) {
dis.dispatch({ action: 'close_settings' }); dis.dispatch({ action: 'close_settings' });
} }
}
}, },
render: function() { render: function() {