some overall changes

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2019-05-24 09:34:36 +02:00
committed by Julius Härtl
parent f71f24c450
commit 501545f2e5
7 changed files with 160 additions and 98 deletions

View File

@@ -26,7 +26,8 @@
<div v-if="board" class="board">
<container lock-axix="y" orientation="horizontal" @drop="onDropStack">
<draggable v-for="stack in stacksByBoard" :key="stack.id" class="stack">
<h3>{{ stack.title }}
<stack :stack="stack" />
<!-- <h3>{{ stack.title }}
<button v-tooltip="t('deck', 'Delete')" class="icon-delete"
@click="deleteStack(stack)" />
</h3>
@@ -41,7 +42,7 @@
<span class="hidden-visually">Add card</span>
</div>
</div>
-->
</draggable>
</container>
</div>
@@ -58,15 +59,17 @@
import { Container, Draggable } from 'vue-smooth-dnd'
import { mapState } from 'vuex'
import Controls from '../Controls'
import CardItem from '../cards/CardItem'
/* import CardItem from '../cards/CardItem' */
import Stack from './Stack'
export default {
name: 'Board',
components: {
CardItem,
/* CardItem, */
Controls,
Container,
Draggable
Draggable,
Stack
},
inject: [
'boardApi'
@@ -88,10 +91,10 @@ export default {
}),
stacksByBoard() {
return this.$store.getters.stacksByBoard(this.board.id)
},
cardsByStack() {
return (id) => this.$store.getters.cardsByStack(id)
}
/* cardsByStack() {
return (id) => this.$store.getters.cardsByStack(id)
} */
},
watch: {
'$route': 'fetchData'
@@ -112,14 +115,14 @@ export default {
onDropStack({ removedIndex, addedIndex }) {
this.$store.dispatch('orderStack', { stack: this.stacksByBoard[removedIndex], removedIndex, addedIndex })
},
onDropCard({ removedIndex, addedIndex }) {
/* onDropCard({ removedIndex, addedIndex }) {
},
payloadForCard(stackId) {
}, */
/* payloadForCard(stackId) {
return index => {
return this.cardsByStack(stackId)[index]
}
},
}, */
createStack() {
let newStack = {
title: 'FooBar',
@@ -127,10 +130,10 @@ export default {
order: this.stacksByBoard().length
}
this.$store.dispatch('createStack', newStack)
},
deleteStack(stack) {
this.$store.dispatch('deleteStack', stack)
}
/* deleteStack(stack) {
this.$store.dispatch('deleteStack', stack)
} */
}
}
</script>
@@ -151,6 +154,7 @@ export default {
padding-top: 0;
}
/*
.smooth-dnd-container.vertical {
display: flex;
flex-direction: column;
@@ -162,6 +166,6 @@ export default {
.smooth-dnd-container.vertical .smooth-dnd-draggable-wrapper {
height: auto;
}
} */
</style>