summaryrefslogtreecommitdiffstats
path: root/client/components/swimlanes
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-04-23 00:54:39 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-04-23 02:55:33 +0200
commit981ed546f1cae45ad8b92b393ee29c1a26277f32 (patch)
treed14a2bd2ff6798c98c373589e8d87edd912174b0 /client/components/swimlanes
parentc1287248a6a4975133790deab6747530e5ece3cb (diff)
downloadwekan-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')
-rw-r--r--client/components/swimlanes/swimlanes.js26
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(),
);