preparation hide checklist-items per card

This commit is contained in:
Martin Filser 2023-09-15 21:47:05 +02:00
parent f6d2b08025
commit d949753d54
8 changed files with 12 additions and 110 deletions

View file

@ -202,6 +202,9 @@ BlazeComponent.extendComponent({
events() {
const events = {
'click #toggleHideCheckedItemsButton'() {
Meteor.call('toggleHideCheckedItems');
},
};
return [
@ -271,11 +274,6 @@ 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();
@ -303,26 +301,9 @@ 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;