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 committed Feb 4, 2024
1 parent eb6ed4f commit 6d70e52
Showing 1 changed file with 10 additions and 0 deletions.
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 6d70e52

Please sign in to comment.