From a69f8905644453c38787cb20bfbcf6c677dca1f8 Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Fri, 27 Dec 2024 13:16:58 +0100 Subject: [PATCH] fix(pat tinymce): Fix Link/Image modal when inline mode is activated. --- src/pat/tinymce/js/links.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pat/tinymce/js/links.js b/src/pat/tinymce/js/links.js index d39055698..d6634ea92 100644 --- a/src/pat/tinymce/js/links.js +++ b/src/pat/tinymce/js/links.js @@ -318,12 +318,14 @@ var AnchorLink = LinkType.extend({ }); const add_image = (editor) => { - var pattern_inst = document.getElementById(editor.id)["pattern-tinymce"].instance; + // in case of inline mode we need the node where the pattern is instantinated + // not the tinymce editable div ("-editable") + var pattern_inst = document.getElementById(editor.id.replace("-editable", ""))["pattern-tinymce"].instance; pattern_inst.addImageClicked(); } const add_link = (editor) => { - var pattern_inst = document.getElementById(editor.id)["pattern-tinymce"].instance; + var pattern_inst = document.getElementById(editor.id.replace("-editable", ""))["pattern-tinymce"].instance; pattern_inst.addLinkClicked(); }