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.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 724e805b..22ed9e57 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -96,6 +96,16 @@ BlazeComponent.extendComponent({
MultiSelection.toggle(this.currentData()._id);
},
+ canSeeAddCard() {
+ return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+
+ reachedWipLimit() {
+ const list = Template.currentData();
+ if( !list.getWipLimit() ) { return false; }
+ return list.getWipLimit('enabled') && list.getWipLimit('value') === list.cards().count();
+ },
+
events() {
return [{
'click .js-minicard': this.clickOnMiniCard,
@@ -239,10 +249,3 @@ BlazeComponent.extendComponent({
});
},
}).register('addCardForm');
-
-
-Template.listBody.helpers({
- canSeeAddCard() {
- return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
- },
-});