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>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
szaimen authored and nextcloud-command committed Aug 17, 2022
1 parent d2187d1 commit eb2c6be
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

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 eb2c6be

Please sign in to comment.