Replace mquandalle:collection-mutations with collection helpers

This commit is contained in:
Harry Adel 2026-01-21 19:22:54 +02:00
parent aca661583d
commit 94a3575e2c
35 changed files with 718 additions and 1321 deletions

View file

@ -62,10 +62,10 @@ BlazeComponent.extendComponent({
textarea.focus();
},
deleteSubtask() {
async deleteSubtask() {
const subtask = this.currentData().subtask;
if (subtask && subtask._id) {
subtask.archive();
await subtask.archive();
}
},
@ -73,12 +73,12 @@ BlazeComponent.extendComponent({
return ReactiveCache.getCurrentUser().isBoardAdmin();
},
editSubtask(event) {
async editSubtask(event) {
event.preventDefault();
const textarea = this.find('textarea.js-edit-subtask-item');
const title = textarea.value.trim();
const subtask = this.currentData().subtask;
subtask.setTitle(title);
await subtask.setTitle(title);
},
pressKey(event) {
@ -105,10 +105,10 @@ BlazeComponent.extendComponent({
}).register('subtasks');
BlazeComponent.extendComponent({
toggleItem() {
async toggleItem() {
const item = this.currentData().item;
if (item && item._id) {
item.toggleItem();
await item.toggleItem();
}
},
events() {
@ -138,11 +138,11 @@ BlazeComponent.extendComponent({
});
}
},
'click .js-delete-subtask' : Popup.afterConfirm('subtaskDelete', function () {
'click .js-delete-subtask' : Popup.afterConfirm('subtaskDelete', async function () {
Popup.back(2);
const subtask = this.subtask;
if (subtask && subtask._id) {
subtask.archive();
await subtask.archive();
}
}),
}