basic implementation of search
This commit is contained in:
parent
0ade5ff640
commit
2ee840922d
3 changed files with 46 additions and 6 deletions
|
@ -44,14 +44,14 @@ module.exports = React.createClass({
|
|||
|
||||
onSearchChange: function(e) {
|
||||
if (e.keyCode === 13) {
|
||||
this.props.onSearch(this.refs.search_term.getDOMNode().value);
|
||||
this.props.onSearch(this.refs.search_term.getDOMNode().value, this.state.scope);
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<div className="mx_SearchBar">
|
||||
<input ref="search_term" className="mx_SearchBar_input" type="text" placeholder="Search..." onChange={this.onSearchChange}/>
|
||||
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder="Search..." onKeyDown={this.onSearchChange}/>
|
||||
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.Room ? " mx_SearchBar_unselected" : "")} onClick={this.onThisRoomClick}>This Room</div>
|
||||
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.All ? " mx_SearchBar_unselected" : "")} onClick={this.onAllRoomsClick}>All Rooms</div>
|
||||
<img className="mx_SearchBar_cancel" src="img/cancel-black.png" width="18" height="18" onClick={this.props.onCancelClick} />
|
||||
|
|
|
@ -63,6 +63,10 @@ module.exports = React.createClass({
|
|||
this.setState(this.getInitialState());
|
||||
},
|
||||
|
||||
onSearchClick: function() {
|
||||
this.setState({ searching: true });
|
||||
},
|
||||
|
||||
onConferenceNotificationClick: function() {
|
||||
dis.dispatch({
|
||||
action: 'place_call',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue