Merge branch 'nztqa-improve-checklist' into devel

When finished input of checklist item, open new checklist item.
Thanks to nztqa ! Closes #828
This commit is contained in:
Lauri Ojansivu 2017-06-30 07:35:15 +03:00
commit cbbdf8442d
3 changed files with 12 additions and 3 deletions

View file

@ -3,9 +3,11 @@
This release adds the following new features: This release adds the following new features:
* [REST API: Add PUT method to update a card](https://github.com/wekan/wekan/pull/1095) and * [REST API: Add PUT method to update a card](https://github.com/wekan/wekan/pull/1095) and
[related fix](https://github.com/wekan/wekan/pull/1097). [related fix](https://github.com/wekan/wekan/pull/1097);
* [When finished input of checklist item, open new checklist
item](https://github.com/wekan/wekan/pull/1099).
Thanks to GitHub user zarnifoulette for contributions! Thanks to GitHub users nztqa and zarnifoulette for their contributions!
# v0.27 2017-06-28 Wekan release # v0.27 2017-06-28 Wekan release

View file

@ -53,7 +53,7 @@ template(name="checklistItems")
else else
+itemDetail(item = item checklist = checklist) +itemDetail(item = item checklist = checklist)
if canModifyCard if canModifyCard
+inlinedForm(classNames="js-add-checklist-item" checklist = checklist) +inlinedForm(autoclose=false classNames="js-add-checklist-item" checklist = checklist)
+addChecklistItemForm +addChecklistItemForm
else else
a.add-checklist-item.js-open-inlined-form a.add-checklist-item.js-open-inlined-form

View file

@ -8,6 +8,9 @@ BlazeComponent.extendComponent({
cardId, cardId,
title, title,
}); });
setTimeout(() => {
this.$('.add-checklist-item').last().click();
}, 100);
}, },
addChecklistItem(event) { addChecklistItem(event) {
@ -16,6 +19,10 @@ BlazeComponent.extendComponent({
const title = textarea.value.trim(); const title = textarea.value.trim();
const checklist = this.currentData().checklist; const checklist = this.currentData().checklist;
checklist.addItem(title); checklist.addItem(title);
// We keep the form opened, empty it.
textarea.value = '';
textarea.focus();
}, },
editChecklist(event) { editChecklist(event) {