resubmit query when switching between "This Room" / "All Rooms"
This commit is contained in:
parent
c07470be7b
commit
cbe3afaa1f
1 changed files with 8 additions and 2 deletions
|
@ -33,11 +33,11 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
onThisRoomClick: function() {
|
||||
this.setState({ scope: 'Room' });
|
||||
this.setState({ scope: 'Room' }, () => this._searchIfQuery());
|
||||
},
|
||||
|
||||
onAllRoomsClick: function() {
|
||||
this.setState({ scope: 'All' });
|
||||
this.setState({ scope: 'All' }, () => this._searchIfQuery());
|
||||
},
|
||||
|
||||
onSearchChange: function(e) {
|
||||
|
@ -49,6 +49,12 @@ module.exports = React.createClass({
|
|||
}
|
||||
},
|
||||
|
||||
_searchIfQuery: function() {
|
||||
if (this.refs.search_term.value) {
|
||||
this.onSearch();
|
||||
}
|
||||
},
|
||||
|
||||
onSearch: function() {
|
||||
this.props.onSearch(this.refs.search_term.value, this.state.scope);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue