PLT-2755 Shortcut to upload file (#2967)

* wrong ref

* Changed back to CTRL+U

* Fixed scope of fileUpload

* Removed stray comma
This commit is contained in:
David Lu
2016-05-12 07:46:12 -04:00
committed by Joram Wilander
parent b6260e827e
commit a4a06aa102

View File

@@ -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');
}
}
}