Skip to content

Commit

Permalink
override jQuery UI sortable _setHandleClassName because of performanc…
Browse files Browse the repository at this point in the history
…e leak from version 1.12

- see more jquery/jquery-ui#2062
- there is still not accepted PR jquery/jquery-ui#2063
  • Loading branch information
malyMiso authored and grossmannmartin committed Feb 14, 2024
1 parent 1f63af4 commit 85b13b1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions assets/js/admin/components/CategoryTreeSorting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 85b13b1

Please sign in to comment.