Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLT-2755 Shortcut to upload file #2848

Merged
merged 2 commits into from
May 2, 2016
Merged

PLT-2755 Shortcut to upload file #2848

merged 2 commits into from
May 2, 2016

Conversation

DavidLu1997
Copy link
Contributor

Added code to use CTRL+U and CMD+U to open the file upload dialog.

Note: CTRL+U opens page source in the latest versions of Firefox and Chrome. CMD+U is currently untested, due to lack of a CMD button.

@mattermod
Copy link
Contributor

Thanks @DavidLu1997 for the pull request!

Per the CONTRIBUTING.md file displayed when you created this pull request, we need to add you to the list of approved contributors for the Mattermost project.

Please help complete the Mattermost contribution license agreement?

This is a standard procedure for many open source projects. Your form should be processed within 24 hours and reviewers for your pull request will be able to proceed.

Please let us know if you have any questions.

We are very happy to have you join our growing community!

@jwilander jwilander added 2: Dev Review Requires review by a developer Needs Seconder labels May 2, 2016

document.addEventListener('keydown', (e) => {
//CTRL+U or CMD+U for file uploads
if ((e.ctrlKey || e.metaKey) && e.keyCode === 85) {
Copy link
Member

@jwilander jwilander May 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a constant to KeyCodes in utils/contants.jsx for 85 and use that here instead?

It would look like
if ((e.ctrlKey || e.metaKey) && e.keyCode === Constants.KeyCodes.U) {
for example.

@jwilander
Copy link
Member

Looks good! +1

@jwilander jwilander removed the 2: Dev Review Requires review by a developer label May 2, 2016
@coreyhulen
Copy link
Contributor

+1

@coreyhulen coreyhulen added 4: Reviews Complete All reviewers have approved the pull request and removed Needs Seconder labels May 2, 2016
@jwilander jwilander merged commit 3e0adf6 into mattermost:master May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants