From: Adam Dullage Date: Sun, 5 May 2024 11:49:58 +0000 (+0100) Subject: Add keyboard shortcut for editing note X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=673dee6149d38e52a71054a9ca89b6ee54c8d42d;p=flatnotes.git Add keyboard shortcut for editing note --- diff --git a/client/views/Note.vue b/client/views/Note.vue index 08c2d46..2a9579e 100644 --- a/client/views/Note.vue +++ b/client/views/Note.vue @@ -73,6 +73,7 @@ import { mdilDelete, mdilPencil, } from "@mdi/light-js"; +import Mousetrap from "mousetrap"; import { useToast } from "primevue/usetoast"; import { computed, ref, watch } from "vue"; import { useRouter } from "vue-router"; @@ -103,6 +104,14 @@ const newTitle = ref(); const toast = useToast(); const toastEditor = ref(); +// 'e' to edit +Mousetrap.bind("e", function () { + console.log("edit"); + if (editMode.value === false) { + editHandler(); + } +}); + function init() { // Return if we already have the note if (props.title == note.value.title) {