From 0e3971f287bd674445ac37b57e93197a5fff955a Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Thu, 28 Jan 2016 18:27:03 +0100 Subject: fixing menu folding --- src/web/js/components/Menu.react.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'src/web/js/components') diff --git a/src/web/js/components/Menu.react.js b/src/web/js/components/Menu.react.js index 91e9ff9e..32197b3d 100644 --- a/src/web/js/components/Menu.react.js +++ b/src/web/js/components/Menu.react.js @@ -51,8 +51,7 @@ var FeedItem = React.createClass({ var Category = React.createClass({ propTypes: {category_id: React.PropTypes.number, active_type: React.PropTypes.string, - active_id: React.PropTypes.number, - glyph: React.PropTypes.object}, + active_id: React.PropTypes.number}, render: function() { var classes = "nav-cat"; if((this.props.active_type == 'category_id' @@ -60,19 +59,19 @@ var Category = React.createClass({ && this.props.active_id == this.props.category_id) { classes += " bg-primary"; } - return (
  • - {this.props.glyph} -

    - {this.props.children} -

    + return (
  • + {this.props.children}
  • ); }, handleClick: function(evnt) { - if(this.props.category_id != null) { - MiddlePanelActions.setCategoryFilter(this.props.category_id); - } else { - MiddlePanelActions.removeParentFilter(); + // hack to avoid selection when clicking on folding icon + if(!evnt.target.classList.contains('glyphicon')) { + if(this.props.category_id != null) { + MiddlePanelActions.setCategoryFilter(this.props.category_id); + } else { + MiddlePanelActions.removeParentFilter(); + } } }, }); @@ -126,9 +125,8 @@ var CategoryGroup = React.createClass({ return ( @@ -197,7 +195,7 @@ var Menu = React.createClass({ - All +

    All

    ); -- cgit