Compare commits

...

2 Commits

Author SHA1 Message Date
Jakob Röhrl
0949886348 now it's working
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2020-01-31 08:43:59 +01:00
Jakob Röhrl
e4ccf431a4 create several cards if the new title contains a linebreak
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
2020-01-30 12:28:27 +01:00

View File

@@ -53,13 +53,13 @@
<form v-if="showAddCard" class="stack--card-add" @submit.prevent="clickAddCard()">
<label for="new-stack-input-main" class="hidden-visually">{{ t('deck', 'Add a new card') }}</label>
<input id="new-stack-input-main"
<textarea id="new-stack-input-main"
v-model="newCardTitle"
v-focus
type="text"
class="no-close"
placeholder="Add a new card"
required>
required />
<input class="icon-confirm"
type="submit"
@@ -161,14 +161,32 @@ export default {
this.editing = false
},
clickAddCard() {
const match = /\r|\n/.exec(this.newCardTitle)
if (match) {
console.log(match)
const results = this.newCardTitle.split(match[0])
results.forEach((line) => {
this.addCard(line)
})
this.newCardTitle = ''
this.showAddCard = false
} else {
this.addCard(this.newCardTitle)
this.newCardTitle = ''
this.showAddCard = false
}
},
addCard(title) {
const newCard = {
title: this.newCardTitle,
title: title,
stackId: this.stack.id,
boardId: this.stack.boardId,
}
this.$store.dispatch('addCard', newCard)
this.newCardTitle = ''
this.showAddCard = false
},
},
}