diff options
author | Corey Hulen <corey@hulen.com> | 2015-11-04 21:23:02 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-11-04 21:23:02 -0800 |
commit | 72a18e7d1093effbfee6845254470b6842a92236 (patch) | |
tree | 9d959f898e0da5a64f96f8eb6832e37022f8232a /web/react/components/rename_channel_modal.jsx | |
parent | 8c2dace188c066f5f70264bc2a34b50d87512e10 (diff) | |
parent | 8e036429353b1ee475492aa6fc05b5e920695892 (diff) | |
download | chat-72a18e7d1093effbfee6845254470b6842a92236.tar.gz chat-72a18e7d1093effbfee6845254470b6842a92236.tar.bz2 chat-72a18e7d1093effbfee6845254470b6842a92236.zip |
Merge pull request #1298 from asaadmahmoodspin/ui-improvements
Multiple UI Improvements
Diffstat (limited to 'web/react/components/rename_channel_modal.jsx')
-rw-r--r-- | web/react/components/rename_channel_modal.jsx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/components/rename_channel_modal.jsx b/web/react/components/rename_channel_modal.jsx index 80f0956f2..9fb3af035 100644 --- a/web/react/components/rename_channel_modal.jsx +++ b/web/react/components/rename_channel_modal.jsx @@ -16,6 +16,7 @@ export default class RenameChannelModal extends React.Component { this.displayNameKeyUp = this.displayNameKeyUp.bind(this); this.handleClose = this.handleClose.bind(this); this.handleShow = this.handleShow.bind(this); + this.handleShown = this.handleShown.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.state = { @@ -118,9 +119,13 @@ export default class RenameChannelModal extends React.Component { const button = $(e.relatedTarget); this.setState({displayName: button.attr('data-display'), channelName: button.attr('data-name'), channelId: button.attr('data-channelid')}); } + handleShown() { + $('#rename_channel #display_name').focus(); + } componentDidMount() { $(ReactDOM.findDOMNode(this.refs.modal)).on('show.bs.modal', this.handleShow); $(ReactDOM.findDOMNode(this.refs.modal)).on('hidden.bs.modal', this.handleClose); + $(ReactDOM.findDOMNode(this.refs.modal)).on('shown.bs.modal', this.handleShown); } componentWillUnmount() { $(ReactDOM.findDOMNode(this.refs.modal)).off('hidden.bs.modal', this.handleClose); @@ -176,6 +181,7 @@ export default class RenameChannelModal extends React.Component { onChange={this.onDisplayNameChange} type='text' ref='displayName' + id='display_name' className='form-control' placeholder='Enter display name' value={this.state.displayName} |