-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
add a shortcut for editing images #1330
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 <szaimen@e.mail.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
5408bfc
to
eb2c6be
Compare
Signed-off-by: szaimen szaimen@e.mail.de