mirror of https://github.com/vector-im/riot-web
resubmit query when switching between "This Room" / "All Rooms"
parent
c07470be7b
commit
cbe3afaa1f
|
@ -33,11 +33,11 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onThisRoomClick: function() {
|
onThisRoomClick: function() {
|
||||||
this.setState({ scope: 'Room' });
|
this.setState({ scope: 'Room' }, () => this._searchIfQuery());
|
||||||
},
|
},
|
||||||
|
|
||||||
onAllRoomsClick: function() {
|
onAllRoomsClick: function() {
|
||||||
this.setState({ scope: 'All' });
|
this.setState({ scope: 'All' }, () => this._searchIfQuery());
|
||||||
},
|
},
|
||||||
|
|
||||||
onSearchChange: function(e) {
|
onSearchChange: function(e) {
|
||||||
|
@ -49,6 +49,12 @@ module.exports = React.createClass({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_searchIfQuery: function() {
|
||||||
|
if (this.refs.search_term.value) {
|
||||||
|
this.onSearch();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onSearch: function() {
|
onSearch: function() {
|
||||||
this.props.onSearch(this.refs.search_term.value, this.state.scope);
|
this.props.onSearch(this.refs.search_term.value, this.state.scope);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue