-
Notifications
You must be signed in to change notification settings - Fork 60
add a shortcut for editing images #1330
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
Conversation
|
/compile amend / |
| window.removeEventListener('keydown', this.keyboardDeleteFile) | ||
| window.removeEventListener('keydown', this.keyboardDownloadFile) | ||
| window.removeEventListener('keydown', this.keyboardEditFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be cleaner to have one method for the keyboardListener?
viewer/src/components/ImageEditor.vue
Lines 161 to 182 in 05de35d
| handleKeydown(event) { | |
| event.stopImmediatePropagation() | |
| // escape key | |
| if (event.key === 'Escape') { | |
| // Since we cannot call the closeMethod and know if there | |
| // are unsaved changes, let's fake a close button trigger. | |
| event.preventDefault() | |
| document.querySelector('.FIE_topbar-close-button').click() | |
| } | |
| // ctrl + S = save | |
| if (event.ctrlKey && event.key === 's') { | |
| event.preventDefault() | |
| document.querySelector('.FIE_topbar-save-button').click() | |
| } | |
| // ctrl + Z = undo | |
| if (event.ctrlKey && event.key === 'z') { | |
| event.preventDefault() | |
| document.querySelector('.FIE_topbar-undo-button').click() | |
| } | |
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably yes? Shall I change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both is fine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, lgtm then :)
Signed-off-by: szaimen <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
5408bfc to
eb2c6be
Compare
Signed-off-by: szaimen [email protected]