From: Alexander Ebert Date: Fri, 27 Nov 2020 16:59:51 +0000 (+0100) Subject: Workaround for the legacy inheritance support X-Git-Tag: 5.4.0_Alpha_1~578 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=afed8681197b2611cd8605a985059ad8ac7461e1;p=GitHub%2FWoltLab%2FWCF.git Workaround for the legacy inheritance support --- 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 4617cf60ed..feae49bcec 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/InlineEditor.js @@ -23,6 +23,14 @@ define(["require", "exports", "tslib", "../../Ajax", "../../Core", "../../Dom/Ch * Initializes the message inline editor. */ constructor(opts) { + this.init(opts); + } + /** + * Helper initialization method for legacy inheritance support. + */ + init(opts) { + // Define the properties again, the constructor might not be + // called in legacy implementations. this._activeDropdownElement = null; this._activeElement = null; this._dropdownMenu = null; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts index af75d13a82..0dd0e8ee22 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Message/InlineEditor.ts @@ -75,16 +75,30 @@ interface AjaxResponseMessage extends ResponseData { } class UiMessageInlineEditor implements AjaxCallbackObject { - protected _activeDropdownElement: HTMLElement | null = null; - protected _activeElement: HTMLElement | null = null; - protected _dropdownMenu: HTMLUListElement | null = null; - protected readonly _elements = new WeakMap(); - protected readonly _options: MessageInlineEditorOptions; + protected _activeDropdownElement: HTMLElement | null; + protected _activeElement: HTMLElement | null; + protected _dropdownMenu: HTMLUListElement | null; + protected _elements: WeakMap; + protected _options: MessageInlineEditorOptions; /** * Initializes the message inline editor. */ constructor(opts: Partial) { + this.init(opts); + } + + /** + * Helper initialization method for legacy inheritance support. + */ + protected init(opts: Partial): void { + // Define the properties again, the constructor might not be + // called in legacy implementations. + this._activeDropdownElement = null; + this._activeElement = null; + this._dropdownMenu = null; + this._elements = new WeakMap(); + this._options = Core.extend( { canEditInline: false,