summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-04-25 09:48:56 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-04-25 09:49:10 +0200
commit6d1cdebfe214c7f67f8cc396cf880d1b5a18f013 (patch)
treec56a01bd7b511bf6aa9489877938ba9568a9a599 /client
parent7cf8487f57058ee7dc4835793b4d51302d145761 (diff)
downloadwekan-6d1cdebfe214c7f67f8cc396cf880d1b5a18f013.tar.gz
wekan-6d1cdebfe214c7f67f8cc396cf880d1b5a18f013.tar.bz2
wekan-6d1cdebfe214c7f67f8cc396cf880d1b5a18f013.zip
Make it compatible with newer and older versions of jQuery sortable
While at it, fix comments and prettify it.
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.js4
-rw-r--r--client/components/cards/checklists.js10
-rw-r--r--client/components/lists/list.js2
-rw-r--r--client/components/swimlanes/swimlanes.js2
4 files changed, 11 insertions, 7 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 8fc3c12a..90014f7d 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -279,10 +279,10 @@ BlazeComponent.extendComponent({
// Disable sorting if the current user is not a board member
this.autorun(() => {
const disabled = !userIsMember() || Utils.isMiniScreen();
- if ($checklistsDom.data('uiSortable')) {
+ if ($checklistsDom.data('uiSortable') || $checklistsDom.data('sortable')) {
$checklistsDom.sortable('option', 'disabled', disabled);
}
- if ($subtasksDom.data('uiSortable')) {
+ if ($subtasksDom.data('uiSortable') || $subtasksDom.data('sortable')) {
$subtasksDom.sortable('option', 'disabled', disabled);
}
});
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 8daf6ee7..ca394aa5 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -54,11 +54,15 @@ BlazeComponent.extendComponent({
return Meteor.user() && Meteor.user().isBoardMember();
}
- // Disable sorting if the current user is not a board member
+ // Disable sorting if the current user is not a board member or is a miniscreen
self.autorun(() => {
const $itemsDom = $(self.itemsDom);
- if ($itemsDom.data('uiSortable')) {
- $(self.itemsDom).sortable('option', 'disabled', !userIsMember() || Utils.isMiniScreen());
+ if ($itemsDom.data('uiSortable') || $itemsDom.data('sortable')) {
+ $(self.itemsDom).sortable(
+ 'option',
+ 'disabled',
+ !userIsMember() || Utils.isMiniScreen(),
+ );
}
});
},
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index a0031b2f..1f622b86 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -139,7 +139,7 @@ BlazeComponent.extendComponent({
});
}
- if ($cards.data('uiSortable')) {
+ if ($cards.data('uiSortable') || $cards.data('sortable')) {
$cards.sortable(
'option',
'disabled',
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 2d299ddc..ea8aaf1d 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -122,7 +122,7 @@ function initSortable(boardComponent, $listsDom) {
}
const $listDom = $listsDom;
- if ($listDom.data('uiSortable')) {
+ if ($listDom.data('uiSortable') || $listDom.data('sortable')) {
$listsDom.sortable(
'option',
'disabled',