From 85b13b15422acfe729ccf3da2cdda8900cd92703 Mon Sep 17 00:00:00 2001 From: Michal Tomka Date: Sun, 4 Feb 2024 23:13:51 +0100 Subject: [PATCH] override jQuery UI sortable _setHandleClassName because of performance leak from version 1.12 - see more https://github.com/jquery/jquery-ui/issues/2062 - there is still not accepted PR https://github.com/jquery/jquery-ui/pull/2063 --- assets/js/admin/components/CategoryTreeSorting.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/js/admin/components/CategoryTreeSorting.js b/assets/js/admin/components/CategoryTreeSorting.js index 909472d1cd..6b51394c5d 100644 --- a/assets/js/admin/components/CategoryTreeSorting.js +++ b/assets/js/admin/components/CategoryTreeSorting.js @@ -13,6 +13,16 @@ export default class CategoryTreeSorting { this.$rootTree = $rootTree; this.$saveButton = $saveButton; + $.mjs.nestedSortable.prototype._setHandleClassName = function () { + this._removeClass(this.element.find('.ui-sortable-handle'), 'ui-sortable-handle'); + $.each(this.items, function () { + (this.instance.options.handle + ? this.item.find(this.instance.options.handle) + : this.item + ).addClass('ui-sortable-handle'); + }); + }; + const _this = this; this.$rootTree.nestedSortable({ listType: 'ul',