summaryrefslogtreecommitdiffstats
path: root/client/components/lists/listBody.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/lists/listBody.js')
-rw-r--r--client/components/lists/listBody.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 724e805b..5ae645a9 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -96,6 +96,15 @@ BlazeComponent.extendComponent({
MultiSelection.toggle(this.currentData()._id);
},
+ canSeeAddCard() {
+ return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+
+ reachedWipLimit() {
+ const list = Template.currentData();
+ return list.wipLimit.enabled && list.wipLimit.value == list.cards().count();
+ },
+
events() {
return [{
'click .js-minicard': this.clickOnMiniCard,
@@ -239,10 +248,3 @@ BlazeComponent.extendComponent({
});
},
}).register('addCardForm');
-
-
-Template.listBody.helpers({
- canSeeAddCard() {
- return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
- },
-});