diff options
author | NicoP-S <paetni1@gmail.com> | 2020-04-26 00:37:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-26 00:37:30 +0200 |
commit | 8e709c1b79b3134d0be95fa922c42d02bb165005 (patch) | |
tree | 296574dd4f710e043c06538e39ec0b709f7924e0 /client/components/cards/cardDetails.js | |
parent | edf52bc4382823ed8768251954371094a849213e (diff) | |
parent | 3908fe0ab875cf4b793c884a3d82df2f1a3b2686 (diff) | |
download | wekan-8e709c1b79b3134d0be95fa922c42d02bb165005.tar.gz wekan-8e709c1b79b3134d0be95fa922c42d02bb165005.tar.bz2 wekan-8e709c1b79b3134d0be95fa922c42d02bb165005.zip |
Merge pull request #6 from wekan/master
Update
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 6ca5d784..f31c3890 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -1,5 +1,5 @@ const subManager = new SubsManager(); -const { calculateIndexData, enableClickOnTouch } = Utils; +const { calculateIndexData } = Utils; let cardColors; Meteor.startup(() => { @@ -56,9 +56,8 @@ BlazeComponent.extendComponent({ }, votePublic() { const card = this.currentData(); - if (card.vote) - return card.vote.public - return null + if (card.vote) return card.vote.public; + return null; }, voteCountPositive() { const card = this.currentData(); @@ -232,9 +231,6 @@ BlazeComponent.extendComponent({ }, }); - // ugly touch event hotfix - enableClickOnTouch('.card-checklist-items .js-checklist'); - const $subtasksDom = this.$('.card-subtasks-items'); $subtasksDom.sortable({ @@ -270,26 +266,18 @@ BlazeComponent.extendComponent({ }, }); - // ugly touch event hotfix - enableClickOnTouch('.card-subtasks-items .js-subtasks'); - function userIsMember() { return Meteor.user() && Meteor.user().isBoardMember(); } // Disable sorting if the current user is not a board member this.autorun(() => { - if ($checklistsDom.data('sortable')) { - $checklistsDom.sortable('option', 'disabled', !userIsMember()); + const disabled = !userIsMember() || Utils.isMiniScreen(); + if ($checklistsDom.data('uiSortable') || $checklistsDom.data('sortable')) { + $checklistsDom.sortable('option', 'disabled', disabled); } - if ($subtasksDom.data('sortable')) { - $subtasksDom.sortable('option', 'disabled', !userIsMember()); - } - if ($checklistsDom.data('sortable')) { - $checklistsDom.sortable('option', 'disabled', Utils.isMiniScreen()); - } - if ($subtasksDom.data('sortable')) { - $subtasksDom.sortable('option', 'disabled', Utils.isMiniScreen()); + if ($subtasksDom.data('uiSortable') || $subtasksDom.data('sortable')) { + $subtasksDom.sortable('option', 'disabled', disabled); } }); }, @@ -379,6 +367,9 @@ BlazeComponent.extendComponent({ this.data().setRequestedBy(''); } }, + 'click .js-go-to-linked-card'() { + Utils.goCardId(this.data().linkedId); + }, 'click .js-member': Popup.open('cardMember'), 'click .js-add-members': Popup.open('cardMembers'), 'click .js-assignee': Popup.open('cardAssignee'), @@ -388,7 +379,7 @@ BlazeComponent.extendComponent({ 'click .js-start-date': Popup.open('editCardStartDate'), 'click .js-due-date': Popup.open('editCardDueDate'), 'click .js-end-date': Popup.open('editCardEndDate'), - 'click .js-show-positive-votes':Popup.open('positiveVoteMembers'), + 'click .js-show-positive-votes': Popup.open('positiveVoteMembers'), 'click .js-show-negative-votes': Popup.open('negativeVoteMembers'), 'mouseenter .js-card-details'() { const parentComponent = this.parentComponent().parentComponent(); @@ -417,9 +408,9 @@ BlazeComponent.extendComponent({ const forIt = $(e.target).hasClass('js-vote-positive'); let newState = null; if ( - this.voteState() == null || - (this.voteState() == false && forIt) || - (this.voteState() == true && !forIt) + this.voteState() === null || + (this.voteState() === false && forIt) || + (this.voteState() === true && !forIt) ) { newState = forIt; } @@ -655,7 +646,7 @@ Template.cardDetailsActionsPopup.events({ }, }); -Template.editCardTitleForm.onRendered(function () { +Template.editCardTitleForm.onRendered(function() { autosize(this.$('.js-edit-card-title')); }); @@ -669,7 +660,7 @@ Template.editCardTitleForm.events({ }, }); -Template.editCardRequesterForm.onRendered(function () { +Template.editCardRequesterForm.onRendered(function() { autosize(this.$('.js-edit-card-requester')); }); @@ -682,7 +673,7 @@ Template.editCardRequesterForm.events({ }, }); -Template.editCardAssignerForm.onRendered(function () { +Template.editCardAssignerForm.onRendered(function() { autosize(this.$('.js-edit-card-assigner')); }); @@ -724,7 +715,7 @@ BlazeComponent.extendComponent({ _id: { $ne: Meteor.user().getTemplatesBoardId() }, }, { - sort: ['title'], + sort: { sort: 1 /* boards default sorting */ }, }, ); return boards; @@ -822,7 +813,7 @@ Template.copyChecklistToManyCardsPopup.events({ // copy subtasks cursor = Cards.find({ parentId: oldId }); - cursor.forEach(function () { + cursor.forEach(function() { 'use strict'; const subtask = arguments[0]; subtask.parentId = _id; @@ -900,7 +891,7 @@ BlazeComponent.extendComponent({ }, }, { - sort: ['title'], + sort: { sort: 1 /* boards default sorting */ }, }, ); return boards; @@ -971,7 +962,7 @@ BlazeComponent.extendComponent({ } } }, - 'click .js-delete': Popup.afterConfirm('cardDelete', function () { + 'click .js-delete': Popup.afterConfirm('cardDelete', function() { Popup.close(); Cards.remove(this._id); Utils.goBoardId(this.boardId); |