summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2017-02-03 01:49:58 +0200
committerLauri Ojansivu <x@xet7.org>2017-02-03 01:49:58 +0200
commit335b91f0a48c2c64a96a74e8a2b9866bf590714a (patch)
tree70bb050626b491155f393db2ff3f5546d6a6ae2c
parent1cf9b1be4e11e276e344088a63e5e0986da70250 (diff)
downloadwekan-335b91f0a48c2c64a96a74e8a2b9866bf590714a.tar.gz
wekan-335b91f0a48c2c64a96a74e8a2b9866bf590714a.tar.bz2
wekan-335b91f0a48c2c64a96a74e8a2b9866bf590714a.zip
Add remaining of checklist feature code
-rw-r--r--client/components/cards/checklists.jade4
-rw-r--r--client/components/cards/checklists.js15
2 files changed, 17 insertions, 2 deletions
diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade
index 396cb107..987e6cd9 100644
--- a/client/components/cards/checklists.jade
+++ b/client/components/cards/checklists.jade
@@ -11,7 +11,7 @@ template(name="checklists")
| {{_ 'add-checklist'}}...
template(name="checklistDetail")
- +inlinedForm(classNames="js-edit-checklist-title")
+ +inlinedForm(classNames="js-edit-checklist-title" checklist = checklist)
+editChecklistItemForm(checklist = checklist)
else
.checklist-title
@@ -43,7 +43,7 @@ template(name="editChecklistItemForm")
template(name="checklistItems")
.checklist-items
each item in checklist.items
- +inlinedForm(classNames="js-edit-checklist-item")
+ +inlinedForm(classNames="js-edit-checklist-item" item = item checklist = checklist)
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
else
+itemDetail(item = item checklist = checklist)
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index b8113a54..5dac7bd3 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -72,3 +72,18 @@ BlazeComponent.extendComponent({
}];
},
}).register('checklists');
+
+BlazeComponent.extendComponent({
+ toggleItem() {
+ const checklist = this.currentData().checklist;
+ const item = this.currentData().item;
+ if (checklist && item && item._id) {
+ checklist.toggleItem(item._id);
+ }
+ },
+ events() {
+ return [{
+ 'click .item .check-box': this.toggleItem,
+ }];
+ },
+}).register('itemDetail');