Add saving the bucket position after dragging it

This commit is contained in:
kolaente 2021-07-28 20:40:22 +02:00
parent 110873c780
commit 410225a5fa
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 1 deletions

View File

@ -501,7 +501,17 @@ export default {
},
updateBucketPosition(e) {
this.dragBucket = false
console.log('drop bucket', e)
const bucket = this.buckets[e.newIndex]
const bucketBefore = this.buckets[e.newIndex - 1] ?? null
const bucketAfter = this.buckets[e.newIndex + 1] ?? null
bucket.position = calculateItemPosition(bucketBefore !== null ? bucketBefore.position : null, bucketAfter !== null ? bucketAfter.position : null)
this.$store.dispatch('kanban/updateBucket', bucket)
.catch(e => {
this.error(e)
})
},
setBucketLimit(bucket) {
if (bucket.limit < 0) {