diff options
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 69e0cfdd..a493d938 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -55,12 +55,6 @@ BlazeComponent.extendComponent({ this.componentParent().showOverlay.set(false); }, - updateCard(modifier) { - Cards.update(this.data()._id, { - $set: modifier, - }); - }, - events() { const events = { [`${CSSEvents.animationend} .js-card-details`]() { @@ -76,13 +70,13 @@ BlazeComponent.extendComponent({ 'submit .js-card-description'(evt) { evt.preventDefault(); const description = this.currentComponent().getValue(); - this.updateCard({ description }); + this.data().setDescription(description); }, 'submit .js-card-details-title'(evt) { evt.preventDefault(); const title = this.currentComponent().getValue(); if ($.trim(title)) { - this.updateCard({ title }); + this.data().setTitle(title); } }, 'click .js-member': Popup.open('cardMember'), @@ -135,14 +129,9 @@ Template.cardDetailsActionsPopup.events({ 'click .js-labels': Popup.open('cardLabels'), 'click .js-attachments': Popup.open('cardAttachments'), 'click .js-move-card': Popup.open('moveCard'), - // 'click .js-copy': Popup.open(), 'click .js-archive'(evt) { evt.preventDefault(); - Cards.update(this._id, { - $set: { - archived: true, - }, - }); + this.archive(); Popup.close(); }, 'click .js-more': Popup.open('cardMore'), @@ -152,13 +141,9 @@ Template.moveCardPopup.events({ 'click .js-select-list'() { // XXX We should *not* get the currentCard from the global state, but // instead from a “component” state. - const cardId = Session.get('currentCard'); + const card = Cards.findOne(Session.get('currentCard')); const newListId = this._id; - Cards.update(cardId, { - $set: { - listId: newListId, - }, - }); + card.move(newListId); Popup.close(); }, }); |