Newer versions of jQuery sortable use uiSortable key

Newer versions of jQuery sortable use `uiSortable` as key to store the data.
Let's adapt the code. While at it, refactor the code.
This commit is contained in:
Marc Hartmayer 2020-04-23 00:54:39 +02:00
parent c1287248a6
commit 981ed546f1
4 changed files with 11 additions and 52 deletions

View file

@ -139,23 +139,12 @@ BlazeComponent.extendComponent({
});
}
if ($cards.data('sortable')) {
if ($cards.data('uiSortable')) {
$cards.sortable(
'option',
'disabled',
// Disable drag-dropping when user is not member/is miniscreen
!userIsMember(),
// Not disable drag-dropping while in multi-selection mode
// MultiSelection.isActive() || !userIsMember(),
);
}
if ($cards.data('sortable')) {
$cards.sortable(
'option',
'disabled',
// Disable drag-dropping when user is not member/is miniscreen
Utils.isMiniScreen(),
!userIsMember() || Utils.isMiniScreen(),
// Not disable drag-dropping while in multi-selection mode
// MultiSelection.isActive() || !userIsMember(),
);