stack add and remove

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2019-05-23 10:49:54 +02:00
committed by Julius Härtl
parent b8cb364f00
commit f71f24c450
9 changed files with 296 additions and 17 deletions

View File

@@ -40,9 +40,11 @@
<div id="stack-add">
<form>
<label for="new-stack-input-main" class="hidden-visually">Add a new stack</label>
<input id="new-stack-input-main" type="text" class="no-close"
<input id="new-stack-input-main" v-model="newStackTitle" type="text"
class="no-close"
placeholder="Add a new stack">
<input class="icon-confirm" type="button" title="Submit">
<input class="icon-confirm" type="button" title="Submit"
@click="clickAddNewStack()">
</form>
</div>
<div class="board-action-buttons">
@@ -68,6 +70,12 @@ export default {
default: null
}
},
data() {
return {
newStackTitle: '',
stack: ''
}
},
computed: {
...mapState({
compactMode: state => state.compactMode
@@ -82,6 +90,12 @@ export default {
},
toggleCompactMode() {
this.$store.dispatch('toggleCompactMode')
},
clickAddNewStack() {
this.stack = { title: this.newStackTitle }
this.$store.dispatch('createStack', this.stack)
this.newStackTitle = ''
this.stack = null
}
}
}