summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/boards.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/models/boards.js b/models/boards.js
index 4baec280..8d2b63e4 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -92,6 +92,12 @@ Boards.helpers({
return _.where(this.members, {isActive: true});
},
+ getLabel(name, color) {
+ return this.labels.find((current) => {
+ return ((current.name === name) && (current.color === color));
+ });
+ },
+
labelIndex(labelId) {
return _.indexOf(_.pluck(this.labels, '_id'), labelId);
},
@@ -293,8 +299,8 @@ if (Meteor.isServer) {
});
});
- // If the user remove one label from a board, we cant to remove reference of
- // this label in any card of this board.
+ // If the user removes a label from a board, we have to remove references to
+ // this label in all cards of the board.
Boards.after.update((userId, doc, fieldNames, modifier) => {
if (!_.contains(fieldNames, 'labels') ||
!modifier.$pull ||