diff options
author | Marc Hartmayer <hello@hartmayer.com> | 2020-04-23 00:54:39 +0200 |
---|---|---|
committer | Marc Hartmayer <hello@hartmayer.com> | 2020-04-23 02:55:33 +0200 |
commit | 981ed546f1cae45ad8b92b393ee29c1a26277f32 (patch) | |
tree | d14a2bd2ff6798c98c373589e8d87edd912174b0 /client/components/swimlanes/swimlanes.js | |
parent | c1287248a6a4975133790deab6747530e5ece3cb (diff) | |
download | wekan-981ed546f1cae45ad8b92b393ee29c1a26277f32.tar.gz wekan-981ed546f1cae45ad8b92b393ee29c1a26277f32.tar.bz2 wekan-981ed546f1cae45ad8b92b393ee29c1a26277f32.zip |
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.
Diffstat (limited to 'client/components/swimlanes/swimlanes.js')
-rw-r--r-- | client/components/swimlanes/swimlanes.js | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js index b7a55ce6..577bf6d2 100644 --- a/client/components/swimlanes/swimlanes.js +++ b/client/components/swimlanes/swimlanes.js @@ -122,34 +122,12 @@ function initSortable(boardComponent, $listsDom) { } const $listDom = $listsDom; - if ($listDom.data('sortable')) { + if ($listDom.data('uiSortable')) { $listsDom.sortable( 'option', 'disabled', // Disable drag-dropping when user is not member/is worker/is miniscreen - !userIsMember(), - // Not disable drag-dropping while in multi-selection mode - // MultiSelection.isActive() || !userIsMember(), - ); - } - - if ($listDom.data('sortable')) { - $listsDom.sortable( - 'option', - 'disabled', - // Disable drag-dropping when user is not member/is worker/is miniscreen - Meteor.user().isWorker(), - // Not disable drag-dropping while in multi-selection mode - // MultiSelection.isActive() || !userIsMember(), - ); - } - - if ($listDom.data('sortable')) { - $listsDom.sortable( - 'option', - 'disabled', - // Disable drag-dropping when user is not member/is worker/is miniscreen - Utils.isMiniScreen(), + !userIsMember() || Meteor.user().isWorker() || Utils.isMiniScreen(), // Not disable drag-dropping while in multi-selection mode // MultiSelection.isActive() || !userIsMember(), ); |