Skip to content

Commit

Permalink
Merge pull request #1417 from plone/petschki-tinymce-inline-fix
Browse files Browse the repository at this point in the history
fix(pat tinymce): Fix Link/Image modal when inline mode is activated.
  • Loading branch information
petschki authored Dec 27, 2024
2 parents 615154f + a69f890 commit 6b46098
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pat/tinymce/js/links.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 6b46098

Please sign in to comment.