Move `this._options.options.toleranceElement` to `this._options.toleranceElement...
authorCyperghost <olaf_schmitz_1@t-online.de>
Fri, 29 Nov 2024 11:05:16 +0000 (12:05 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 29 Nov 2024 11:05:16 +0000 (12:05 +0100)
ts/WoltLabSuite/Core/Ui/Sortable/List.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Sortable/List.js

index d9f72f8e8788378af6e570f16210a64bc91ca302..382a6e58301cf98bf0dd1fc54f7432087ecf6335 100644 (file)
@@ -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.`);
index 7b631a3c42477b57a3cd4fa168a17b2131794508..f20faa011d54a2205f31a6615f5259e131d62317 100644 (file)
@@ -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.`);