From 113fc696d885eec3ce55ed67cade8a81b4bd96b1 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 16 Feb 2018 17:43:24 +0000 Subject: [PATCH 1/2] Implement global filter to deselect all tags and make TagPanel scrollable whilst we're at it. --- src/components/structures/TagPanel.js | 51 +++++++++++++++++---------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 6e3bcf521b..74b6656b79 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { MatrixClient } from 'matrix-js-sdk'; +import GeminiScrollbar from 'react-gemini-scrollbar'; import TagOrderStore from '../../stores/TagOrderStore'; import GroupActions from '../../actions/GroupActions'; @@ -93,9 +94,14 @@ const TagPanel = React.createClass({ dis.dispatch({action: 'view_create_group'}); }, + onLogoClick(ev) { + dis.dispatch({action: 'deselect_tags'}); + }, + render() { const GroupsButton = sdk.getComponent('elements.GroupsButton'); const DNDTagTile = sdk.getComponent('elements.DNDTagTile'); + const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const tags = this.state.orderedTags.map((tag, index) => { return ; }); return
- - { (provided, snapshot) => ( -
- { tags } - { provided.placeholder } -
- ) } -
+ + + +
+ + + { (provided, snapshot) => ( +
+ { tags } + { provided.placeholder } +
+ ) } +
+
+
From 7a0c82a327b7df5e28160c10cfd89fb55ee9b798 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 16 Feb 2018 18:08:29 +0000 Subject: [PATCH 2/2] Fix click background to deselect --- src/components/structures/TagPanel.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/structures/TagPanel.js b/src/components/structures/TagPanel.js index 74b6656b79..d614588ccc 100644 --- a/src/components/structures/TagPanel.js +++ b/src/components/structures/TagPanel.js @@ -84,8 +84,6 @@ const TagPanel = React.createClass({ }, onClick(e) { - // Ignore clicks on children - if (e.target !== e.currentTarget) return; dis.dispatch({action: 'deselect_tags'}); }, @@ -116,7 +114,11 @@ const TagPanel = React.createClass({
- + { tags } { provided.placeholder }