From 98dcb7b66dea2fcc8b554271cc6aa43163e3b3d3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 19 Apr 2020 00:03:53 +0000 Subject: [PATCH] --- ayanova/src/components/wiki-control.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ayanova/src/components/wiki-control.vue b/ayanova/src/components/wiki-control.vue index 9daa5d16..bc82aaca 100644 --- a/ayanova/src/components/wiki-control.vue +++ b/ayanova/src/components/wiki-control.vue @@ -239,8 +239,8 @@ import DOMPurify from "dompurify"; export default { created() { - // Add a hook to make all links open a new window + //https://github.com/cure53/DOMPurify/blob/master/demos/hooks-target-blank-demo.html DOMPurify.addHook("afterSanitizeAttributes", function(node) { // set all elements owning target to target=_blank if ("target" in node) { @@ -420,7 +420,6 @@ export default { } }, handleInput(val) { - debugger; this.$emit("input", val); this.localVal = val; }, @@ -495,6 +494,7 @@ export default { clickBold() { this.getSelectedRange(); this.replaceSelectedText("**" + this.getSelectedText() + "**"); + this.handleInput(this.localVal); }, clickItalic() { this.getSelectedRange(); @@ -673,6 +673,9 @@ todo: all editing controls enabled todo: replace all redundant clickXXX functions with a single function and a flag indicating what to do + - HANDLE INPUT must be called from that function so that th eparent form knows a change was made + because right now menu clicks changing text doesn't trigger the changedd event + todo: Undo / redo (ctrl-z / ctrl-y) ability? - may need a library for this one if it's tricky to support levels of undo