mirror of
https://github.com/wekan/wekan.git
synced 2026-01-02 15:48:49 +01:00
At opened card, toggle to show checklist at minicard. Part 4.
Thanks to xet7 !
This commit is contained in:
parent
1a35db62b1
commit
86814a0fd8
7 changed files with 58 additions and 42 deletions
|
|
@ -202,12 +202,6 @@ BlazeComponent.extendComponent({
|
|||
|
||||
events() {
|
||||
const events = {
|
||||
'click #toggleShowChecklistAtMinicardButton'() {
|
||||
Meteor.call('toggleShowChecklistAtMinicard');
|
||||
},
|
||||
'click #toggleHideCheckedItemsButton'() {
|
||||
Meteor.call('toggleHideCheckedItems');
|
||||
},
|
||||
};
|
||||
|
||||
return [
|
||||
|
|
@ -277,6 +271,11 @@ Template.checklists.helpers({
|
|||
const ret = card.checklists();
|
||||
return ret;
|
||||
},
|
||||
showAtMinicard() {
|
||||
const card = ReactiveCache.getCard(this.cardId);
|
||||
const ret = card.checklists({'showAtMinicard':1});
|
||||
return ret;
|
||||
},
|
||||
hideCheckedItems() {
|
||||
const currentUser = ReactiveCache.getCurrentUser();
|
||||
if (currentUser) return currentUser.hasHideCheckedItems();
|
||||
|
|
@ -304,9 +303,26 @@ BlazeComponent.extendComponent({
|
|||
}).register('addChecklistItemForm');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
toggleItem() {
|
||||
const checklist = this.currentData().checklist;
|
||||
const item = this.currentData().item;
|
||||
if (checklist && item && item._id) {
|
||||
item.toggleItem();
|
||||
}
|
||||
},
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'click .js-checklist-item .check-box-container': this.toggleItem,
|
||||
'click #toggleShowChecklistAtMinicardButton'() {
|
||||
const checklist = this.checklist;
|
||||
if (checklist && checklist._id) {
|
||||
Meteor.call('toggleShowChecklistAtMinicard', checklist._id);
|
||||
}
|
||||
},
|
||||
'click #toggleHideCheckedItemsButton'() {
|
||||
Meteor.call('toggleHideCheckedItems');
|
||||
},
|
||||
'click .js-delete-checklist': Popup.afterConfirm('checklistDelete', function () {
|
||||
Popup.back(2);
|
||||
const checklist = this.checklist;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue