From: Michael D. Lowis Date: Thu, 30 Nov 2017 18:00:15 +0000 (-0500) Subject: fixed quote shortcut X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=4fa3193b23b337d8538b3cc54ee9e68e5fc0ce4d;p=proto%2Fjournal.git fixed quote shortcut --- diff --git a/editor.js b/editor.js index 5be7118..4bf0145 100644 --- a/editor.js +++ b/editor.js @@ -52,8 +52,11 @@ ";": (evnt) => keyCmd(evnt, "insertHTML", "\r\n"), "'": (evnt) => { - const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "

" : "

"); - return !document.execCommand("formatBlock", false, block); + if (evnt.ctrlKey || evnt.metaKey) { + const block = (getSelNode().nodeName === "BLOCKQUOTE" ? "

" : "

"); + return !document.execCommand("formatBlock", false, block); + } + return true; }, }; @@ -64,7 +67,7 @@ return "" + date.getFullYear() + "." + (month > 9 ? '' : '0') + month + "." + - (day > 9 ? '' : '0') + day + (day > 9 ? '' : '0') + day; }; header.onkeyup = (evnt) => {