Skip to content

Commit

Permalink
add a shortcut for editing images
Browse files Browse the repository at this point in the history
Signed-off-by: szaimen <szaimen@e.mail.de>
  • Loading branch information
szaimen committed Aug 17, 2022
1 parent d2187d1 commit 5408bfc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,14 @@ export default {
subscribe('files:sidebar:closed', this.handleAppSidebarClose)
window.addEventListener('keydown', this.keyboardDeleteFile)
window.addEventListener('keydown', this.keyboardDownloadFile)
window.addEventListener('keydown', this.keyboardEditFile)
},
beforeDestroy() {
window.removeEventListener('resize', this.onResize)
window.removeEventListener('keydown', this.keyboardDeleteFile)
window.removeEventListener('keydown', this.keyboardDownloadFile)
window.removeEventListener('keydown', this.keyboardEditFile)
},
destroyed() {
Expand Down Expand Up @@ -696,6 +698,15 @@ export default {
}
},
keyboardEditFile(event) {
if (event.key === 'e' && event.ctrlKey === true) {
event.preventDefault()
if (this.canEdit) {
this.onEdit()
}
}
},
cleanup() {
// reset all properties
this.currentFile = {}
Expand Down

0 comments on commit 5408bfc

Please sign in to comment.