Delete checklist moved to checklist menu action

This commit is contained in:
Martin Filser 2022-01-11 19:26:44 +01:00
parent 7651c00d57
commit e40e42103e
3 changed files with 19 additions and 11 deletions

View file

@ -191,13 +191,6 @@ BlazeComponent.extendComponent({
{
...events,
'click .js-open-checklist-details-menu': Popup.open('checklistActions'),
'click .toggle-delete-checklist-dialog' : Popup.afterConfirm('checklistDelete', function () {
Popup.close();
const checklist = this.checklist;
if (checklist && checklist._id) {
Checklists.remove(checklist._id);
}
}),
'submit .js-add-checklist': this.addChecklist,
'submit .js-edit-checklist-title': this.editChecklist,
'submit .js-add-checklist-item': this.addChecklistItem,
@ -294,6 +287,22 @@ BlazeComponent.extendComponent({
}
}).register('addChecklistItemForm');
BlazeComponent.extendComponent({
events() {
return [
{
'click .js-delete-checklist' : Popup.afterConfirm('checklistDelete', function () {
Popup.back(2);
const checklist = this.checklist;
if (checklist && checklist._id) {
Checklists.remove(checklist._id);
}
}),
}
]
}
}).register('checklistActionsPopup');
BlazeComponent.extendComponent({
onRendered() {
autosize(this.$('textarea.js-edit-checklist-item'));