From 20a9e5912fc57add0c6fbec50947c67e455d4836 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Sat, 21 Dec 2024 18:28:08 +0100 Subject: [PATCH] Recover systematic showing of ui elements (only visible in ballon editor if usable). --- private/js/cms.tiptap.js | 2 +- private/js/tiptap_plugins/cms.styles.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/private/js/cms.tiptap.js b/private/js/cms.tiptap.js index b26dc43..215c8a4 100644 --- a/private/js/cms.tiptap.js +++ b/private/js/cms.tiptap.js @@ -122,7 +122,7 @@ class CMSTipTapPlugin { save_callback: save_callback, settings: settings, }); - el.addEventListener('focusout', ({editor, event}) => { + editor.on('blur', ({editor, event}) => { this._blurEditor(editor, event); }); editor.on('update', ({editor}) => { diff --git a/private/js/tiptap_plugins/cms.styles.js b/private/js/tiptap_plugins/cms.styles.js index e81da2c..44677fd 100644 --- a/private/js/tiptap_plugins/cms.styles.js +++ b/private/js/tiptap_plugins/cms.styles.js @@ -5,16 +5,16 @@ import {Mark, mergeAttributes,} from '@tiptap/core'; +'use strict'; + const _markElement = { addOptions() { - 'use strict'; return { HTMLAttributes: {}, }; }, parseHTML() { - 'use strict'; return [ { tag: this.name.toLowerCase() @@ -22,7 +22,6 @@ const _markElement = { ]; }, renderHTML({ HTMLAttributes }) { - 'use strict'; return [this.name.toLowerCase(), mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]; }, addCommands() {