summaryrefslogtreecommitdiffstats
path: root/client/components/lists/list.js
diff options
context:
space:
mode:
authorRomulus Tsai 蔡仲明 <urakagi@gmail.com>2020-05-08 09:35:11 +0800
committerRomulus Tsai 蔡仲明 <urakagi@gmail.com>2020-05-08 09:35:11 +0800
commitcfcc73724fcd394150d1b815d0a7a4c466e216b5 (patch)
treea9648255f14cd8b0e1ad8eee1f8d42337a0668bc /client/components/lists/list.js
parenta3658993128bdddd5d40f792c19281dc5eac51f5 (diff)
parent533bc045d06269dba2f42cdfe61817a1b3407974 (diff)
downloadwekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.tar.gz
wekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.tar.bz2
wekan-cfcc73724fcd394150d1b815d0a7a4c466e216b5.zip
Merge branch 'master' of https://github.com/wekan/wekan
Diffstat (limited to 'client/components/lists/list.js')
-rw-r--r--client/components/lists/list.js29
1 files changed, 16 insertions, 13 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index 89d51e85..839304f8 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -1,6 +1,6 @@
import { Cookies } from 'meteor/ostrio:cookies';
const cookies = new Cookies();
-const { calculateIndex, enableClickOnTouch } = Utils;
+const { calculateIndex } = Utils;
BlazeComponent.extendComponent({
// Proxy
@@ -114,9 +114,6 @@ BlazeComponent.extendComponent({
},
});
- // ugly touch event hotfix
- enableClickOnTouch(itemsSelector);
-
this.autorun(() => {
let showDesktopDragHandles = false;
currentUser = Meteor.user();
@@ -129,18 +126,26 @@ BlazeComponent.extendComponent({
showDesktopDragHandles = false;
}
- if (!Utils.isMiniScreen() && showDesktopDragHandles) {
+ if (Utils.isMiniScreen() || showDesktopDragHandles) {
$cards.sortable({
handle: '.handle',
});
- } else {
+ } else if (!Utils.isMiniScreen() && !showDesktopDragHandles) {
$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());
+ if ($cards.data('uiSortable') || $cards.data('sortable')) {
+ $cards.sortable(
+ 'option',
+ 'disabled',
+ // Disable drag-dropping when user is not member
+ !userIsMember(),
+ // Not disable drag-dropping while in multi-selection mode
+ // MultiSelection.isActive() || !userIsMember(),
+ );
+ }
});
// We want to re-run this function any time a card is added.
@@ -176,12 +181,10 @@ Template.list.helpers({
currentUser = Meteor.user();
if (currentUser) {
return (currentUser.profile || {}).showDesktopDragHandles;
+ } else if (cookies.has('showDesktopDragHandles')) {
+ return true;
} else {
- if (cookies.has('showDesktopDragHandles')) {
- return true;
- } else {
- return false;
- }
+ return false;
}
},
});