diff options
-rw-r--r-- | client/components/cards/cardDetails.styl | 7 | ||||
-rw-r--r-- | models/cards.js | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl index 5ad0c9f5..c981e2a2 100644 --- a/client/components/cards/cardDetails.styl +++ b/client/components/cards/cardDetails.styl @@ -71,16 +71,17 @@ .card-details-items display: flex flex-wrap: wrap - margin: 15px 0 + margin: 0 0 15px .card-details-item - margin-right: 0.5em + margin: 15px 0.5em 0 0 &:last-child margin-right: 0 &.card-details-item-labels, &.card-details-item-members, &.card-details-item-start, - &.card-details-item-due + &.card-details-item-due, + &.card-details-item-customfield max-width: 50% flex-grow: 1 diff --git a/models/cards.js b/models/cards.js index 6896970c..670a47cb 100644 --- a/models/cards.js +++ b/models/cards.js @@ -186,6 +186,10 @@ Cards.helpers({ return this.checklistItemCount() !== 0; }, + customFieldIndex(customFieldId) { + return _.pluck(this.customFields, '_id').indexOf(customFieldId); + }, + absoluteUrl() { const board = this.board(); return FlowRouter.url('card', { @@ -255,7 +259,7 @@ Cards.mutations({ assignCustomField(customFieldId) { console.log("assignCustomField", customFieldId); - return {$push: {customFields: {_id: customFieldId, value: null}}}; + return {$addToSet: {customFields: {_id: customFieldId, value: null}}}; }, unassignCustomField(customFieldId) { @@ -264,7 +268,7 @@ Cards.mutations({ }, toggleCustomField(customFieldId) { - if (this.customFields && this.customFields[customFieldId]) { + if (this.customFields && this.customFieldIndex(customFieldId) > -1) { return this.unassignCustomField(customFieldId); } else { return this.assignCustomField(customFieldId); |