summaryrefslogtreecommitdiffstats
path: root/client/components/lists/list.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-11-13 19:33:13 +0200
committerLauri Ojansivu <x@xet7.org>2019-11-13 19:40:48 +0200
commit274a997e62b421b034e1eb0b3a486813fe127240 (patch)
tree580d0926825d368cf231c0869c4fa5d389ff9a44 /client/components/lists/list.js
parent82f092491467fa773a662eb2a2a9bc9b20646312 (diff)
downloadwekan-274a997e62b421b034e1eb0b3a486813fe127240.tar.gz
wekan-274a997e62b421b034e1eb0b3a486813fe127240.tar.bz2
wekan-274a997e62b421b034e1eb0b3a486813fe127240.zip
Fix card, list and swimlane move.
Allow moving cards in multiselect mode. Closes #2771, closes #2743, closes #2704, related #2081
Diffstat (limited to 'client/components/lists/list.js')
-rw-r--r--client/components/lists/list.js27
1 files changed, 14 insertions, 13 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index b7b8b2e0..6bd8eefe 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -31,18 +31,6 @@ BlazeComponent.extendComponent({
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
const $cards = this.$('.js-minicards');
- if (Utils.isMiniScreen) {
- $('.js-minicards').sortable({
- handle: '.handle',
- });
- }
-
- if (!Utils.isMiniScreen && showDesktopDragHandles) {
- $('.js-minicards').sortable({
- handle: '.handle',
- });
- }
-
$cards.sortable({
connectWith: '.js-minicards:not(.js-list-full)',
tolerance: 'pointer',
@@ -128,8 +116,21 @@ BlazeComponent.extendComponent({
// ugly touch event hotfix
enableClickOnTouch(itemsSelector);
- // Disable drag-dropping if the current user is not a board member or is comment only
this.autorun(() => {
+ if (
+ Utils.isMiniScreen() ||
+ (!Utils.isMiniScreen() && Meteor.user().hasShowDesktopDragHandles())
+ ) {
+ $cards.sortable({
+ handle: '.handle',
+ });
+ } else {
+ $cards.sortable({
+ handle: '.minicard',
+ });
+ }
+
+ // Disable drag-dropping if the current user is not a board member or is comment only
$cards.sortable('option', 'disabled', !userIsMember());
});