From: Alexander Ebert Date: Fri, 28 Apr 2023 13:56:23 +0000 (+0200) Subject: Discard the draft before destroying the editor instance X-Git-Tag: 6.0.0_Alpha_1~172^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3e18db8c39b77399e5c0148147f319f28166d273;p=GitHub%2FWoltLab%2FWCF.git Discard the draft before destroying the editor instance Fixes #5462 --- diff --git a/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts index 063a9b02fc..3ff9de746d 100644 --- a/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts +++ b/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts @@ -577,12 +577,12 @@ class UiMessageInlineEditor implements AjaxCallbackObject { } } + getCkeditorById(this._getEditorId())!.discardDraft(); + this._restoreMessage(); this._updateHistory(this._getHash(this._getObjectId(activeElement))); - getCkeditorById(this._getEditorId())!.discardDraft(); - UiNotification.show(); if (this._options.quoteManager) { diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js index afac8a09c9..cfd1eec30f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js @@ -452,9 +452,9 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Component/Ckeditor/Eve elementData.messageBody.insertAdjacentElement("afterbegin", pollContainer); } } + (0, Ckeditor_1.getCkeditorById)(this._getEditorId()).discardDraft(); this._restoreMessage(); this._updateHistory(this._getHash(this._getObjectId(activeElement))); - (0, Ckeditor_1.getCkeditorById)(this._getEditorId()).discardDraft(); UiNotification.show(); if (this._options.quoteManager) { this._options.quoteManager.clearAlternativeEditor();