summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authornztqa <nztqa@users.noreply.github.com>2017-07-01 23:03:54 +0900
committernztqa <nztqa@users.noreply.github.com>2017-07-01 23:03:54 +0900
commit29f65be1e008e7106253f3c8cb8d751079696e45 (patch)
tree59975ddc868785e0ebec24fa8292fbe2f2178510 /client
parentcbbdf8442dbe9026176098843b6377346c5ec117 (diff)
downloadwekan-29f65be1e008e7106253f3c8cb8d751079696e45.tar.gz
wekan-29f65be1e008e7106253f3c8cb8d751079696e45.tar.bz2
wekan-29f65be1e008e7106253f3c8cb8d751079696e45.zip
Add check to see if input is empty
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/checklists.jade2
-rw-r--r--client/components/cards/checklists.js23
2 files changed, 16 insertions, 9 deletions
diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade
index c59b6307..d04a9b60 100644
--- a/client/components/cards/checklists.jade
+++ b/client/components/cards/checklists.jade
@@ -4,7 +4,7 @@ template(name="checklists")
each checklist in currentCard.checklists
+checklistDetail(checklist = checklist)
if canModifyCard
- +inlinedForm(classNames="js-add-checklist" cardId = cardId)
+ +inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
+addChecklistItemForm
else
a.js-open-inlined-form
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 93bf0c19..24a78035 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -4,13 +4,18 @@ BlazeComponent.extendComponent({
const textarea = this.find('textarea.js-add-checklist-item');
const title = textarea.value.trim();
const cardId = this.currentData().cardId;
- Checklists.insert({
- cardId,
- title,
- });
- setTimeout(() => {
- this.$('.add-checklist-item').last().click();
- }, 100);
+
+ if (title) {
+ Checklists.insert({
+ cardId,
+ title,
+ });
+ setTimeout(() => {
+ this.$('.add-checklist-item').last().click();
+ }, 100);
+ }
+ textarea.value = '';
+ textarea.focus();
},
addChecklistItem(event) {
@@ -18,8 +23,10 @@ BlazeComponent.extendComponent({
const textarea = this.find('textarea.js-add-checklist-item');
const title = textarea.value.trim();
const checklist = this.currentData().checklist;
- checklist.addItem(title);
+ if (title) {
+ checklist.addItem(title);
+ }
// We keep the form opened, empty it.
textarea.value = '';
textarea.focus();