summaryrefslogtreecommitdiffstats
path: root/client/components/cards/checklists.js
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2019-10-01 00:48:36 +0300
committerLauri Ojansivu <x@xet7.org>2019-10-01 00:48:36 +0300
commit98c38fe58f597cbc0389676ae880704a671e480b (patch)
tree56044051bc05c6d2ee9a942987a5740b3ea12d73 /client/components/cards/checklists.js
parent44378fe9d10f690a42dc79f0e07aebade7f708f1 (diff)
downloadwekan-98c38fe58f597cbc0389676ae880704a671e480b.tar.gz
wekan-98c38fe58f597cbc0389676ae880704a671e480b.tar.bz2
wekan-98c38fe58f597cbc0389676ae880704a671e480b.zip
Drag handles continue. In progress.
Thanks to xet7 !
Diffstat (limited to 'client/components/cards/checklists.js')
-rw-r--r--client/components/cards/checklists.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 57939eb8..1a3a3265 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -4,11 +4,11 @@ function initSorting(items) {
items.sortable({
tolerance: 'pointer',
helper: 'clone',
- items: '.js-checklist-item:not(.placeholder)',
+ items: '.js-checklist-item-handle:not(.placeholder)',
connectWith: '.js-checklist-items',
appendTo: '.board-canvas',
distance: 7,
- placeholder: 'checklist-item placeholder',
+ placeholder: 'checklist-item-handle placeholder',
scroll: false,
start(evt, ui) {
ui.placeholder.height(ui.helper.height());
@@ -17,11 +17,11 @@ function initSorting(items) {
stop(evt, ui) {
const parent = ui.item.parents('.js-checklist-items');
const checklistId = Blaze.getData(parent.get(0)).checklist._id;
- let prevItem = ui.item.prev('.js-checklist-item').get(0);
+ let prevItem = ui.item.prev('.js-checklist-item-handle').get(0);
if (prevItem) {
prevItem = Blaze.getData(prevItem).item;
}
- let nextItem = ui.item.next('.js-checklist-item').get(0);
+ let nextItem = ui.item.next('.js-checklist-item-handle').get(0);
if (nextItem) {
nextItem = Blaze.getData(nextItem).item;
}
@@ -38,7 +38,7 @@ function initSorting(items) {
});
// ugly touch event hotfix
- enableClickOnTouch('.js-checklist-item:not(.placeholder)');
+ enableClickOnTouch('.js-checklist-item-handle:not(.placeholder)');
}
BlazeComponent.extendComponent({
@@ -197,6 +197,12 @@ BlazeComponent.extendComponent({
},
}).register('checklists');
+Template.checklists.helpers({
+ showDesktopDragHandles() {
+ return Meteor.user().hasShowDesktopDragHandles();
+ },
+});
+
Template.checklistDeleteDialog.onCreated(() => {
const $cardDetails = this.$('.card-details');
this.scrollState = {
@@ -231,6 +237,9 @@ Template.checklistItemDetail.helpers({
!Meteor.user().isCommentOnly()
);
},
+ showDesktopDragHandles() {
+ return Meteor.user().hasShowDesktopDragHandles();
+ },
});
BlazeComponent.extendComponent({