From 902c8a7b5c64c32e5bdc8f3bac2b58cc4a2c8c8b Mon Sep 17 00:00:00 2001 From: GT <788449+gtgt@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:05:19 +0200 Subject: [PATCH] Fix jQuery UI sortable plugin checks to be compatible with webpack Replace jQuery.ui with $.ui in code. --- jquery.collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.collection.js b/jquery.collection.js index 29789fb..896f780 100644 --- a/jquery.collection.js +++ b/jquery.collection.js @@ -869,14 +869,14 @@ // drag & drop support: this is a bit more complex than pressing "up" or // "down" buttons because we can move elements more than one place ahead // or below... - if ((typeof jQuery.ui !== 'undefined' && typeof jQuery.ui.sortable !== 'undefined') + if ((typeof $.ui !== 'undefined' && typeof $.ui.sortable !== 'undefined') && collection.data('sortable')) { collection.sortable('disable'); } if (settings.drag_drop && settings.allow_up && settings.allow_down) { var oldPosition; var newPosition; - if (typeof jQuery.ui === 'undefined' || typeof jQuery.ui.sortable === 'undefined') { + if (typeof $.ui === 'undefined' || typeof $.ui.sortable === 'undefined') { settings.drag_drop = false; } else { collection.sortable($.extend(true, {}, {