diff options
author | Florian Orben <florian.orben@gmail.com> | 2015-10-29 17:39:22 +0100 |
---|---|---|
committer | Florian Orben <florian.orben@gmail.com> | 2015-10-29 17:44:10 +0100 |
commit | 7e70788c947af34e742b681aab2ecdcde63b7463 (patch) | |
tree | c787672874d4b1b47a06df18afe7cc48d3cdd39e /web/react/components/edit_post_modal.jsx | |
parent | ca04e3bbc3be78edd4ba7c9f051543499dcfa0f3 (diff) | |
download | chat-7e70788c947af34e742b681aab2ecdcde63b7463.tar.gz chat-7e70788c947af34e742b681aab2ecdcde63b7463.tar.bz2 chat-7e70788c947af34e742b681aab2ecdcde63b7463.zip |
simplify check if ctrl+enter was pressed
Diffstat (limited to 'web/react/components/edit_post_modal.jsx')
-rw-r--r-- | web/react/components/edit_post_modal.jsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/web/react/components/edit_post_modal.jsx b/web/react/components/edit_post_modal.jsx index 2629d6b25..2abb3f151 100644 --- a/web/react/components/edit_post_modal.jsx +++ b/web/react/components/edit_post_modal.jsx @@ -57,12 +57,10 @@ export default class EditPostModal extends React.Component { this.setState({editText: editMessage}); } handleEditKeyPress(e) { - if (this.state.ctrlSend === 'true' && e.ctrlKey || this.state.ctrlSend === 'false') { - if (e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) { - e.preventDefault(); - ReactDOM.findDOMNode(this.refs.editbox).blur(); - this.handleEdit(e); - } + if (this.state.ctrlSend === 'false' && e.which === KeyCodes.ENTER && !e.shiftKey && !e.altKey) { + e.preventDefault(); + ReactDOM.findDOMNode(this.refs.editbox).blur(); + this.handleEdit(e); } } handleUserInput(e) { |