diff options
author | Elias Nahum <nahumhbl@gmail.com> | 2016-09-07 01:12:27 -0300 |
---|---|---|
committer | Elias Nahum <nahumhbl@gmail.com> | 2016-09-07 01:12:27 -0300 |
commit | a5ebbcfdb4f151de204b6be276c5f07175ceb82a (patch) | |
tree | ff9e92ee490536e4f21208ce5d5f9ab232b21bfb /webapp/components/edit_post_modal.jsx | |
parent | dde7b50adfbe7023459c41c1ade874338da27f26 (diff) | |
download | chat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.tar.gz chat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.tar.bz2 chat-a5ebbcfdb4f151de204b6be276c5f07175ceb82a.zip |
PLT-4084 Fix Unable to send messages in RC
Diffstat (limited to 'webapp/components/edit_post_modal.jsx')
-rw-r--r-- | webapp/components/edit_post_modal.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp/components/edit_post_modal.jsx b/webapp/components/edit_post_modal.jsx index c2ffb2ed7..00c8e0f09 100644 --- a/webapp/components/edit_post_modal.jsx +++ b/webapp/components/edit_post_modal.jsx @@ -28,6 +28,7 @@ export default class EditPostModal extends React.Component { this.handleEdit = this.handleEdit.bind(this); this.handleEditKeyPress = this.handleEditKeyPress.bind(this); this.handleEditPostEvent = this.handleEditPostEvent.bind(this); + this.handleKeyDown = this.handleKeyDown.bind(this); this.handleInput = this.handleInput.bind(this); this.onPreferenceChange = this.onPreferenceChange.bind(this); this.onModalHidden = this.onModalHidden.bind(this); @@ -118,6 +119,12 @@ export default class EditPostModal extends React.Component { $(ReactDOM.findDOMNode(this.refs.modal)).modal('show'); } + handleKeyDown(e) { + if (this.state.ctrlSend && e.keyCode === KeyCodes.ENTER && e.ctrlKey === true) { + this.handleEdit(); + } + } + onPreferenceChange() { this.setState({ ctrlSend: PreferenceStore.getBool(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'send_on_ctrl_enter') @@ -222,7 +229,8 @@ export default class EditPostModal extends React.Component { <div className='edit-modal-body modal-body'> <Textbox onInput={this.handleInput} - onKeyDown={this.handleEditKeyPress} + onKeyPress={this.handleEditKeyPress} + onKeyDown={this.handleKeyDown} messageText={this.state.editText} createMessage={Utils.localizeMessage('edit_post.editPost', 'Edit the post...')} supportsCommands={false} |