summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/file_upload.jsx7
-rw-r--r--webapp/utils/constants.jsx3
2 files changed, 9 insertions, 1 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() {
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index 3f8980bfa..d08ecfef7 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -544,7 +544,8 @@ export default {
ENTER: 13,
ESCAPE: 27,
SPACE: 32,
- TAB: 9
+ TAB: 9,
+ U: 85
},
CODE_PREVIEW_MAX_FILE_SIZE: 500000, // 500 KB
HighlightedLanguages: {