summaryrefslogtreecommitdiffstats
path: root/webapp/components/file_upload.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-02 15:38:40 -0400
committerJoram Wilander <jwawilander@gmail.com>2016-05-02 15:38:40 -0400
commit3e0adf6227dbe466936924f1ba27b71a7a3d6acb (patch)
treeac00ef643362720a156d1d796498dd8634a54f3a /webapp/components/file_upload.jsx
parent2fb6c689b7291117e691d50f51fdda2451db9da3 (diff)
downloadchat-3e0adf6227dbe466936924f1ba27b71a7a3d6acb.tar.gz
chat-3e0adf6227dbe466936924f1ba27b71a7a3d6acb.tar.bz2
chat-3e0adf6227dbe466936924f1ba27b71a7a3d6acb.zip
PLT-2755 Shortcut to upload file (#2848)
* Added file upload shortcuts (CTRL+U and CMD+U) * Added KeyCode for U
Diffstat (limited to 'webapp/components/file_upload.jsx')
-rw-r--r--webapp/components/file_upload.jsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/webapp/components/file_upload.jsx b/webapp/components/file_upload.jsx
index 4852a0cbf..8e4019f6f 100644
--- a/webapp/components/file_upload.jsx
+++ b/webapp/components/file_upload.jsx
@@ -261,6 +261,13 @@ class FileUpload extends React.Component {
}
}
});
+
+ document.addEventListener('keydown', (e) => {
+ //CTRL+U or CMD+U for file uploads
+ if ((e.ctrlKey || e.metaKey) && e.keyCode === Constants.KeyCodes.U) {
+ $(this.refs.input).focus().trigger('click');
+ }
+ });
}
componentWillUnmount() {