mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 17:48:49 +01:00
Add checklist at top
This commit is contained in:
parent
3c1eff6241
commit
52d54f35a3
4 changed files with 45 additions and 2 deletions
|
|
@ -97,16 +97,26 @@ BlazeComponent.extendComponent({
|
|||
//if (card.isLinked()) cardId = card.linkedId;
|
||||
if (card.isLinkedCard()) cardId = card.linkedId;
|
||||
|
||||
let sortIndex;
|
||||
let checklistItemIndex;
|
||||
if (this.currentData().position === 'top') {
|
||||
sortIndex = Utils.calculateIndexData(null, card.firstChecklist()).base;
|
||||
checklistItemIndex = 0;
|
||||
} else {
|
||||
sortIndex = Utils.calculateIndexData(card.lastChecklist(), null).base;
|
||||
checklistItemIndex = -1;
|
||||
}
|
||||
|
||||
if (title) {
|
||||
Checklists.insert({
|
||||
cardId,
|
||||
title,
|
||||
sort: card.checklists().count(),
|
||||
sort: sortIndex,
|
||||
});
|
||||
this.closeAllInlinedForms();
|
||||
setTimeout(() => {
|
||||
this.$('.add-checklist-item')
|
||||
.last()
|
||||
.eq(checklistItemIndex)
|
||||
.click();
|
||||
}, 100);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue