diff options
author | David Lu <david.lu@hotmail.com> | 2016-05-12 07:46:12 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-05-12 07:46:12 -0400 |
commit | a4a06aa102e4abc1c4e75098f723d7b64dffeee5 (patch) | |
tree | 62f6f255fa73ede5ab638485285f8ac6d905dbe1 /webapp | |
parent | b6260e827ebf6985854af258b6c32bd8d4951aeb (diff) | |
download | chat-a4a06aa102e4abc1c4e75098f723d7b64dffeee5.tar.gz chat-a4a06aa102e4abc1c4e75098f723d7b64dffeee5.tar.bz2 chat-a4a06aa102e4abc1c4e75098f723d7b64dffeee5.zip |
PLT-2755 Shortcut to upload file (#2967)
* wrong ref
* Changed back to CTRL+U
* Fixed scope of fileUpload
* Removed stray comma
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/file_upload.jsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webapp/components/file_upload.jsx b/webapp/components/file_upload.jsx index 05f1701a8..829e580b9 100644 --- a/webapp/components/file_upload.jsx +++ b/webapp/components/file_upload.jsx @@ -284,7 +284,10 @@ class FileUpload extends React.Component { keyUpload(e) { if ((e.ctrlKey || e.metaKey) && e.keyCode === Constants.KeyCodes.U) { - $(this.refs.input).focus().trigger('click'); + e.preventDefault(); + if (this.props.postType === 'post' && document.activeElement.id === 'post_textbox' || this.props.postType === 'comment' && document.activeElement.id === 'reply_textbox') { + $(this.refs.fileInput).focus().trigger('click'); + } } } |