Skip to content

Commit 5e140b3

Browse files
committed
add stack button on empty board
Signed-off-by: Jakob Röhrl <[email protected]>
1 parent 1efc584 commit 5e140b3

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/components/board/Board.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@
3434
orientation="horizontal"
3535
:drag-handle-selector="dragHandleSelector"
3636
@drop="onDropStack">
37+
<form v-if="stacksByBoard.length === 0" @submit.prevent="addNewStack()">
38+
<h4 for="new-stack-input-main">
39+
{{ t('deck', 'Add new list') }}
40+
</h4>
41+
<input id="new-stack-input-main"
42+
v-model="newStackTitle"
43+
v-focus
44+
type="text"
45+
class="no-close"
46+
:placeholder="t('deck', 'List name')"
47+
required>
48+
<input v-tooltip="t('deck', 'Add new list')"
49+
class="icon-confirm"
50+
type="submit"
51+
value="">
52+
</form>
53+
3754
<Draggable v-for="stack in stacksByBoard" :key="stack.id">
3855
<Stack :stack="stack" />
3956
</Draggable>
@@ -75,6 +92,7 @@ export default {
7592
data: function() {
7693
return {
7794
loading: true,
95+
newStackTitle: '',
7896
}
7997
},
8098
computed: {
@@ -117,11 +135,10 @@ export default {
117135
this.$store.dispatch('orderStack', { stack: this.stacksByBoard[removedIndex], removedIndex, addedIndex })
118136
},
119137
120-
createStack() {
138+
addNewStack() {
121139
const newStack = {
122-
title: 'FooBar',
140+
title: this.newStackTitle,
123141
boardId: this.id,
124-
order: this.stacksByBoard().length,
125142
}
126143
this.$store.dispatch('createStack', newStack)
127144
},

0 commit comments

Comments
 (0)