WIP search stuff

This commit is contained in:
Matthew Hodgson 2015-10-28 19:41:23 +00:00
parent 0bfb1416c1
commit cb095ba5a0
1 changed files with 5 additions and 3 deletions

View File

@ -43,13 +43,15 @@ module.exports = React.createClass({
},
onSearchChange: function(e) {
if (e.keyCode === 13) {
this.props.onSearch(this.refs.search_term.getDOMNode().value);
}
},
render: function() {
return (
<div className="mx_SearchBar">
<input className="mx_SearchBar_input" type="text" placeholder="Search..." onChange={this.onSearchChange}/>
<input ref="search_term" className="mx_SearchBar_input" type="text" placeholder="Search..." onChange={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} />