aboutsummaryrefslogtreecommitdiff
path: root/src/web
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-01-28 18:27:03 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-28 18:31:43 +0100
commit0e3971f287bd674445ac37b57e93197a5fff955a (patch)
treeffb4d7530eb574aa85e2a3213576454e377252bf /src/web
parentpretty icons (diff)
downloadnewspipe-0e3971f287bd674445ac37b57e93197a5fff955a.tar.gz
newspipe-0e3971f287bd674445ac37b57e93197a5fff955a.tar.bz2
newspipe-0e3971f287bd674445ac37b57e93197a5fff955a.zip
fixing menu folding
Diffstat (limited to 'src/web')
-rw-r--r--src/web/js/components/Menu.react.js28
1 files changed, 13 insertions, 15 deletions
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 (<li className={classes}>
- {this.props.glyph}
- <h4 onClick={this.handleClick}>
- {this.props.children}
- </h4>
+ return (<li className={classes} onClick={this.handleClick}>
+ {this.props.children}
</li>
);
},
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 (<ul className="nav nav-sidebar">
<Category category_id={this.props.cat_id}
active_id={this.props.active_id}
- active_type={this.props.active_type}
- glyph={ctrl}>
- <strong>{this.props.name}</strong> {unread}
+ active_type={this.props.active_type}>
+ {ctrl}<h4>{this.props.name}</h4>{unread}
</Category>
{feeds}
</ul>
@@ -197,7 +195,7 @@ var Menu = React.createClass({
<Category category_id={null}
active_id={this.state.active_id}
active_type={this.state.active_type}>
- <strong>All</strong>
+ <h4>All</h4>
</Category>
</ul>
);
bgstack15