diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/web/js/app.js | 3 | ||||
-rw-r--r-- | src/web/js/components/Menu.react.js | 16 | ||||
-rw-r--r-- | src/web/js/components/MiddlePanel.react.js | 22 |
3 files changed, 29 insertions, 12 deletions
diff --git a/src/web/js/app.js b/src/web/js/app.js index 603172b3..00156670 100644 --- a/src/web/js/app.js +++ b/src/web/js/app.js @@ -8,10 +8,11 @@ */ var React = require('react'); +var ReactDOM = require('react-dom'); var MainApp = require('./components/MainApp.react'); -React.render( +ReactDOM.render( <MainApp />, document.getElementById('jarrapp') ); diff --git a/src/web/js/components/Menu.react.js b/src/web/js/components/Menu.react.js index 75255d41..f699f92e 100644 --- a/src/web/js/components/Menu.react.js +++ b/src/web/js/components/Menu.react.js @@ -20,7 +20,6 @@ var FeedItem = React.createClass({ render: function() { var icon = null; var badge_unread = null; - var style = null; if(this.props.icon_url){ icon = (<img width="16px" src={this.props.icon_url} />); } else { @@ -152,21 +151,30 @@ var MenuFilter = React.createClass({ if (this.props.feed_in_error) { error_button = ( <Button active={this.props.filter == "error"} - onMouseDown={() => MenuActions.setFilter("error")} + onMouseDown={this.setErrorFilter} bsSize="small" bsStyle="warning">Error</Button> ); } return (<ButtonGroup className="nav nav-sidebar"> <Button active={this.props.filter == "all"} - onMouseDown={() => MenuActions.setFilter("all")} + onMouseDown={this.setAllFilter} bsSize="small">All</Button> <Button active={this.props.filter == "unread"} - onMouseDown={() => MenuActions.setFilter("unread")} + onMouseDown={this.setUnreadFilter} bsSize="small">Unread</Button> {error_button} </ButtonGroup> ); }, + setAllFilter: function() { + MenuActions.setFilter("all"); + }, + setUnreadFilter: function() { + MenuActions.setFilter("unread"); + }, + setErrorFilter: function() { + MenuActions.setFilter("error"); + }, }); var Menu = React.createClass({ diff --git a/src/web/js/components/MiddlePanel.react.js b/src/web/js/components/MiddlePanel.react.js index 0a1dad45..01c8b696 100644 --- a/src/web/js/components/MiddlePanel.react.js +++ b/src/web/js/components/MiddlePanel.react.js @@ -60,13 +60,13 @@ var MiddlePanelFilter = React.createClass({ return (<Row className="show-grid"> <ButtonGroup> <Button active={this.state.filter == "all"} - onMouseDown={() => this.setFilter("all")} + onMouseDown={this.setAllFilter} bsSize="small">All</Button> <Button active={this.state.filter == "unread"} - onMouseDown={() => this.setFilter("unread")} + onMouseDown={this.setUnreadFilter} bsSize="small">Unread</Button> <Button active={this.state.filter == "liked"} - onMouseDown={() => this.setFilter("liked")} + onMouseDown={this.setLikedFilter} bsSize="small">Liked</Button> </ButtonGroup> <ButtonGroup> @@ -76,10 +76,18 @@ var MiddlePanelFilter = React.createClass({ </Row> ); }, - setFilter: function(filter) { - this.setState({filter: filter}); - MiddlePanelActions.setFilter(filter); - } + setAllFilter: function() { + this.setState({filter: 'all'}); + MiddlePanelActions.setFilter('all'); + }, + setUnreadFilter: function() { + this.setState({filter: 'unread'}); + MiddlePanelActions.setFilter('unread'); + }, + setLikedFilter: function() { + this.setState({filter: 'liked'}); + MiddlePanelActions.setFilter('liked'); + }, }); var MiddlePanel = React.createClass({ |