summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md9
-rw-r--r--client/components/cards/checklists.js13
2 files changed, 21 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d954f603..33747762 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,12 @@
+# Upcoming Wekan release
+
+This release adds the following new features:
+
+- [Pre-fill the title of checklists (Trello-style)](https://github.com/wekan/wekan/pull/3030).
+ Thanks to boeserwolf.
+
+Thanks to above GitHub users for their contributions and translators for their translations.
+
# v3.97 2020-04-19 Wekan release
This release adds the following new features:
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 94d8176b..5acab536 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -1,4 +1,4 @@
-const { calculateIndexData, enableClickOnTouch } = Utils;
+const { calculateIndexData, enableClickOnTouch, capitalize } = Utils;
function initSorting(items) {
items.sortable({
@@ -177,6 +177,16 @@ BlazeComponent.extendComponent({
}
},
+ focusChecklistItem(event) {
+ // If a new checklist is created, pre-fill the title and select it.
+ const checklist = this.currentData().checklist;
+ if (!checklist) {
+ const textarea = event.target;
+ textarea.value = capitalize(TAPi18n.__('r-checklist'));
+ textarea.select();
+ }
+ },
+
events() {
const events = {
'click .toggle-delete-checklist-dialog'(event) {
@@ -196,6 +206,7 @@ BlazeComponent.extendComponent({
'submit .js-edit-checklist-item': this.editChecklistItem,
'click .js-delete-checklist-item': this.deleteItem,
'click .confirm-checklist-delete': this.deleteChecklist,
+ 'focus .js-add-checklist-item': this.focusChecklistItem,
keydown: this.pressKey,
},
];