Skip to content

Commit 1c9d61d

Browse files
committed
dedicated search button
1 parent 7b702c4 commit 1c9d61d

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

‎src/components/views/rooms/SearchBar.js‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,19 @@ module.exports = React.createClass({
3939

4040
onSearchChange: function(e) {
4141
if (e.keyCode === 13) { // on enter...
42-
this.props.onSearch(this.refs.search_term.value, this.state.scope);
42+
this.onSearch();
4343
}
4444
},
45+
46+
onSearch: function() {
47+
this.props.onSearch(this.refs.search_term.value, this.state.scope);
48+
},
4549

4650
render: function() {
4751
return (
4852
<div className="mx_SearchBar">
4953
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder="Search..." onKeyDown={this.onSearchChange}/>
54+
<img className="mx_SearchBar_searchButton" src="img/search-button.svg" width="37" height="37" onClick={this.onSearch}/>
5055
<div className={"mx_SearchBar_button" + (this.state.scope !== 'Room' ? " mx_SearchBar_unselected" : "")} onClick={this.onThisRoomClick}>This Room</div>
5156
<div className={"mx_SearchBar_button" + (this.state.scope !== 'All' ? " mx_SearchBar_unselected" : "")} onClick={this.onAllRoomsClick}>All Rooms</div>
5257
<img className="mx_SearchBar_cancel" src="img/cancel.svg" width="18" height="18" onClick={this.props.onCancelClick} />

‎src/skins/vector/css/molecules/SearchBar.css‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@ limitations under the License.
2121
align-items: center;
2222
}
2323

24-
.mx_SearchBar input {
24+
.mx_SearchBar_input {
2525
display: inline block;
2626
border-radius: 3px;
2727
border: 1px solid #f0f0f0;
2828
font-size: 15px;
2929
padding: 9px;
3030
padding-left: 11px;
31-
margin-right: 17px;
3231
width: auto;
3332
flex: 1 1 0;
3433
}
3534

35+
.mx_SearchBar_searchButton {
36+
cursor: pointer;
37+
margin-right: 10px;
38+
}
39+
3640
.mx_SearchBar_button {
3741
display: inline;
3842
border: 0px;
Lines changed: 16 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)