Skip to content

Commit

Permalink
fix: hotkey ctrl-s
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <luka@nextcloud.com>
  • Loading branch information
luka-nextcloud authored and mejo- committed Jun 28, 2023
1 parent 06f4bf5 commit 111853b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div id="editor-container"
data-text-el="editor-container"
class="text-editor"
@keydown.esc.stop.prevent="() => {}">
@keydown.stop="onKeyDown">
<DocumentStatus v-if="displayedStatus"
:idle="idle"
:lock="lock"
Expand Down Expand Up @@ -714,6 +714,18 @@ export default {
outlineToggled(visible) {
this.emit('outline-toggled', visible)
},
onKeyDown(event) {
if (event.key === 'Escape') {
event.preventDefault()
return
}
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
this.$syncService.save()
event.preventDefault()
}
},
},
}
</script>
Expand Down

0 comments on commit 111853b

Please sign in to comment.