summaryrefslogtreecommitdiffstats
path: root/client/components/cards/subtasks.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/cards/subtasks.js')
-rw-r--r--client/components/cards/subtasks.js53
1 files changed, 1 insertions, 52 deletions
diff --git a/client/components/cards/subtasks.js b/client/components/cards/subtasks.js
index a611ae26..e65ef518 100644
--- a/client/components/cards/subtasks.js
+++ b/client/components/cards/subtasks.js
@@ -1,43 +1,3 @@
-const { calculateIndexData } = Utils;
-
-function initSorting(items) {
- items.sortable({
- tolerance: 'pointer',
- helper: 'clone',
- items: '.js-subtasks-item:not(.placeholder)',
- connectWith: '.js-subtasks-items',
- appendTo: '.board-canvas',
- distance: 7,
- placeholder: 'subtasks-item placeholder',
- scroll: false,
- start(evt, ui) {
- ui.placeholder.height(ui.helper.height());
- EscapeActions.executeUpTo('popup-close');
- },
- stop(evt, ui) {
- const parent = ui.item.parents('.js-subtasks-items');
- const subtasksId = Blaze.getData(parent.get(0)).subtasks._id;
- let prevItem = ui.item.prev('.js-subtasks-item').get(0);
- if (prevItem) {
- prevItem = Blaze.getData(prevItem).item;
- }
- let nextItem = ui.item.next('.js-subtasks-item').get(0);
- if (nextItem) {
- nextItem = Blaze.getData(nextItem).item;
- }
- const nItems = 1;
- const sortIndex = calculateIndexData(prevItem, nextItem, nItems);
- const subtasksDomElement = ui.item.get(0);
- const subtasksData = Blaze.getData(subtasksDomElement);
- const subtasksItem = subtasksData.item;
-
- items.sortable('cancel');
-
- subtasksItem.move(subtasksId, sortIndex.base);
- },
- });
-}
-
BlazeComponent.extendComponent({
canModifyCard() {
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
@@ -151,16 +111,5 @@ Template.subtaskItemDetail.helpers({
});
BlazeComponent.extendComponent({
- toggleItem() {
- const subtasks = this.currentData().subtasks;
- const item = this.currentData().item;
- if (subtasks && item && item._id) {
- item.toggleItem();
- }
- },
- events() {
- return [{
- 'click .js-subtasks-item .check-box': this.toggleItem,
- }];
- },
+ // ...
}).register('subtaskItemDetail');