diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-12-15 11:40:46 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2016-12-15 13:40:46 -0300 |
commit | 7f48a7fc9d2238134414668e0b520115706b8b2d (patch) | |
tree | c7b485e0305a46e10ea997ea3450c2c040efcb95 /webapp/components/searchable_user_list.jsx | |
parent | c35b95709e293680f882f27ab6e616bf8f92a7cc (diff) | |
download | chat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.gz chat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.bz2 chat-7f48a7fc9d2238134414668e0b520115706b8b2d.zip |
PLT-4815 Refactor 'More Channels' modal into the new modal pattern (#4742)
* Refactor 'More Channels' modal into the new modal pattern
* Fix unit test
* Readded CSS changes
Diffstat (limited to 'webapp/components/searchable_user_list.jsx')
-rw-r--r-- | webapp/components/searchable_user_list.jsx | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/webapp/components/searchable_user_list.jsx b/webapp/components/searchable_user_list.jsx index 3fa912d6d..8058010ea 100644 --- a/webapp/components/searchable_user_list.jsx +++ b/webapp/components/searchable_user_list.jsx @@ -4,8 +4,6 @@ import UserList from 'components/user_list.jsx'; import * as Utils from 'utils/utils.jsx'; -import Constants from 'utils/constants.jsx'; -const KeyCodes = Constants.KeyCodes; import $ from 'jquery'; import React from 'react'; @@ -21,8 +19,6 @@ export default class SearchableUserList extends React.Component { this.nextPage = this.nextPage.bind(this); this.previousPage = this.previousPage.bind(this); this.doSearch = this.doSearch.bind(this); - this.onSearchBoxKeyPress = this.onSearchBoxKeyPress.bind(this); - this.onSearchBoxChange = this.onSearchBoxChange.bind(this); this.nextTimeoutId = 0; @@ -71,20 +67,6 @@ export default class SearchableUserList extends React.Component { } } - onSearchBoxKeyPress(e) { - if (e.charCode === KeyCodes.ENTER) { - e.preventDefault(); - this.doSearch(); - } - } - - onSearchBoxChange(e) { - if (e.target.value === '') { - this.props.search(''); // clear search - this.setState({page: 0, search: false}); - } - } - render() { let nextButton; let previousButton; @@ -158,28 +140,14 @@ export default class SearchableUserList extends React.Component { return ( <div className='filtered-user-list'> <div className='filter-row'> - <div className='col-xs-9 col-sm-5'> + <div className='col-xs-12'> <input ref='filter' className='form-control filter-textbox' - placeholder={Utils.localizeMessage('filtered_user_list.search', 'Press enter to search')} - onKeyPress={this.onSearchBoxKeyPress} - onChange={this.onSearchBoxChange} + placeholder={Utils.localizeMessage('filtered_user_list.search', 'Search users')} + onInput={this.doSearch} /> </div> - <div className='col-xs-3 col-sm-2 filter-button'> - <button - type='button' - className='btn btn-primary' - onClick={this.doSearch} - disabled={this.props.users == null} - > - <FormattedMessage - id='filtered_user_list.searchButton' - defaultMessage='Search' - /> - </button> - </div> <div className='col-sm-12'> <span className='member-count pull-left'>{count}</span> </div> |