From 57505c3a6190986264e1b46d2bfac11017c41aeb Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 16 Aug 2017 18:19:12 +0100 Subject: [PATCH] Add behaviour to toggle app draw on app tile header click --- src/components/views/elements/AppTile.js | 20 +++++++++++++++++-- src/components/views/rooms/AppsDrawer.js | 25 ++++++++++++++++-------- src/components/views/rooms/AuxPanel.js | 6 ++++-- 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/components/views/elements/AppTile.js b/src/components/views/elements/AppTile.js index a78b802ad7..1b8689847e 100644 --- a/src/components/views/elements/AppTile.js +++ b/src/components/views/elements/AppTile.js @@ -28,6 +28,7 @@ import AppPermission from './AppPermission'; import AppWarning from './AppWarning'; import MessageSpinner from './MessageSpinner'; import WidgetUtils from '../../../WidgetUtils'; +import dis from '../../../dispatcher'; const ALLOWED_APP_URL_SCHEMES = ['https:', 'http:']; const betaHelpMsg = 'This feature is currently experimental and is intended for beta testing only'; @@ -182,6 +183,21 @@ export default React.createClass({ return appTileName; }, + onClickMenuBar: function(ev) { + ev.preventDefault(); + + // Ignore clicks on menu bar children + if (ev.target !== this.refs.menu_bar) { + return; + } + + // Toggle the view state of the apps drawer + dis.dispatch({ + action: 'appsDrawer', + show: !this.props.show, + }); + }, + render: function() { let appTileBody; @@ -218,7 +234,7 @@ export default React.createClass({ /> ); - } else { + } else if (this.props.show) { appTileBody = (