From: Alexander Ebert Date: Tue, 9 May 2023 13:44:07 +0000 (+0200) Subject: Reset the poll editor on editor reset X-Git-Tag: 6.0.0_Alpha_1~127 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8c1d70a669f354757272dbdf5b76dfb63683f6c;p=GitHub%2FWoltLab%2FWCF.git Reset the poll editor on editor reset Fixes #5492 --- diff --git a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts index 1d0afc3973..df6e9bc344 100644 --- a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts +++ b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts @@ -132,9 +132,11 @@ class UiPollEditor { this.reset(); }); - listenToCkeditor(element).collectMetaData((payload) => { - payload.metaData.poll = this.#getPollData(); - }); + listenToCkeditor(element) + .collectMetaData((payload) => { + payload.metaData.poll = this.#getPollData(); + }) + .reset(() => this.reset()); ["handleError", "submit", "validate"].forEach((event) => { EventHandler.add("com.woltlab.wcf.ckeditor5", event + "_" + this.wysiwygId, (...args: unknown[]) => diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js index 7d31f1da76..be710d406f 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js @@ -73,9 +73,11 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta element.addEventListener("reset", () => { this.reset(); }); - (0, Event_1.listenToCkeditor)(element).collectMetaData((payload) => { + (0, Event_1.listenToCkeditor)(element) + .collectMetaData((payload) => { payload.metaData.poll = this.#getPollData(); - }); + }) + .reset(() => this.reset()); ["handleError", "submit", "validate"].forEach((event) => { EventHandler.add("com.woltlab.wcf.ckeditor5", event + "_" + this.wysiwygId, (...args) => this[event](...args)); });