From: Alexander Ebert Date: Sat, 28 May 2022 12:40:49 +0000 (+0200) Subject: Bad access the editor from within a dialog X-Git-Tag: 5.5.0_Beta_4~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1350266f146063688fd8b0724e9e49d285d08e83;p=GitHub%2FWoltLab%2FWCF.git Bad access the editor from within a dialog See https://www.woltlab.com/community/thread/295640-%C3%BCber-medien-hinzugef%C3%BCgtes-bild-l%C3%A4sst-sich-nach-der-entfernung-nicht-direkt-erneu/ --- diff --git a/ts/WoltLabSuite/Core/Media/Manager/Editor.ts b/ts/WoltLabSuite/Core/Media/Manager/Editor.ts index be26f19e56..82172a174d 100644 --- a/ts/WoltLabSuite/Core/Media/Manager/Editor.ts +++ b/ts/WoltLabSuite/Core/Media/Manager/Editor.ts @@ -266,11 +266,17 @@ class MediaManagerEditor extends MediaManager { link = media[thumbnailSize + "ThumbnailLink"]; } - this._options.editor!.insert.html( - ``, - ); + Core.interactWithRedactor(() => { + this._options.editor!.insert.html( + ``, + ); + }); } else { - this._options.editor!.insert.text(`[wsm='${media.mediaID}'][/wsm]`); + Core.interactWithRedactor(() => { + this._options.editor!.insert.text(`[wsm='${media.mediaID}'][/wsm]`); + }); } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js index 38a612e5aa..e97a0f042f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js @@ -205,10 +205,14 @@ define(["require", "exports", "tslib", "./Base", "../../Core", "../../Event/Hand if (thumbnailSize !== "original") { link = media[thumbnailSize + "ThumbnailLink"]; } - this._options.editor.insert.html(``); + Core.interactWithRedactor(() => { + this._options.editor.insert.html(``); + }); } else { - this._options.editor.insert.text(`[wsm='${media.mediaID}'][/wsm]`); + Core.interactWithRedactor(() => { + this._options.editor.insert.text(`[wsm='${media.mediaID}'][/wsm]`); + }); } } /**