From: Cyperghost Date: Fri, 29 Nov 2024 11:05:16 +0000 (+0100) Subject: Move `this._options.options.toleranceElement` to `this._options.toleranceElement... X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=273de91b93b3363d5da5741aba7b9fcd3571a904;p=GitHub%2FWoltLab%2FWCF.git Move `this._options.options.toleranceElement` to `this._options.toleranceElement` if it exists --- diff --git a/ts/WoltLabSuite/Core/Ui/Sortable/List.ts b/ts/WoltLabSuite/Core/Ui/Sortable/List.ts index d9f72f8e87..382a6e5830 100644 --- a/ts/WoltLabSuite/Core/Ui/Sortable/List.ts +++ b/ts/WoltLabSuite/Core/Ui/Sortable/List.ts @@ -76,6 +76,11 @@ class UiSortableList { opts, ) as SortableListOptions; + // Support legacy options pre 6.2 + if (typeof (this._options.options as any).toleranceElement === "string") { + this._options.toleranceElement = (this._options.options as any).toleranceElement; + } + this.#container = document.getElementById(this._options.containerId); if (!this.#container) { throw new Error(`Container '${this._options.containerId}' not found.`); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js index 7b631a3c42..f20faa011d 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js @@ -48,6 +48,10 @@ define(["require", "exports", "tslib", "../../Core", "sortablejs", "WoltLabSuite isSimpleSorting: false, additionalParameters: {}, }, opts); + // Support legacy options pre 6.2 + if (typeof this._options.options.toleranceElement === "string") { + this._options.toleranceElement = this._options.options.toleranceElement; + } this.#container = document.getElementById(this._options.containerId); if (!this.#container) { throw new Error(`Container '${this._options.containerId}' not found.`);