From 273de91b93b3363d5da5741aba7b9fcd3571a904 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 29 Nov 2024 12:05:16 +0100 Subject: [PATCH] Move `this._options.options.toleranceElement` to `this._options.toleranceElement` if it exists --- ts/WoltLabSuite/Core/Ui/Sortable/List.ts | 5 +++++ .../install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js | 4 ++++ 2 files changed, 9 insertions(+) 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.`); -- 2.20.1