Don't allow dropping a bucket in another bucket
This commit is contained in:
parent
518404691c
commit
1c61792d21
|
@ -19,13 +19,13 @@
|
||||||
<div :class="{ 'is-loading': loading && !oneTaskUpdating}" class="kanban kanban-bucket-container loader-container">
|
<div :class="{ 'is-loading': loading && !oneTaskUpdating}" class="kanban kanban-bucket-container loader-container">
|
||||||
<draggable
|
<draggable
|
||||||
v-model="buckets"
|
v-model="buckets"
|
||||||
@start="() => drag = true"
|
@start="() => dragBucket = true"
|
||||||
@end="updateBucketPosition"
|
@end="updateBucketPosition"
|
||||||
group="buckets"
|
group="buckets"
|
||||||
v-bind="dragOptions"
|
v-bind="dragOptions"
|
||||||
:disabled="!canWrite"
|
:disabled="!canWrite"
|
||||||
>
|
>
|
||||||
<transition-group type="transition" :name="!drag ? 'move-bucket': null" tag="div" class="kanban-bucket-container">
|
<transition-group type="transition" :name="!dragBucket ? 'move-bucket': null" tag="div" class="kanban-bucket-container">
|
||||||
<div
|
<div
|
||||||
:key="`bucket${bucket.id}`"
|
:key="`bucket${bucket.id}`"
|
||||||
class="bucket"
|
class="bucket"
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
v-model="bucket.tasks"
|
v-model="bucket.tasks"
|
||||||
@start="() => drag = true"
|
@start="() => drag = true"
|
||||||
@end="updateTaskPosition"
|
@end="updateTaskPosition"
|
||||||
:group="{name: 'tasks', put: shouldAcceptDrop(bucket)}"
|
:group="{name: 'tasks', put: shouldAcceptDrop(bucket) && !dragBucket}"
|
||||||
v-bind="dragOptions"
|
v-bind="dragOptions"
|
||||||
:disabled="!canWrite"
|
:disabled="!canWrite"
|
||||||
:data-bucket-index="k"
|
:data-bucket-index="k"
|
||||||
|
@ -249,6 +249,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
drag: false,
|
drag: false,
|
||||||
|
dragBucket: false,
|
||||||
dragOptions: {
|
dragOptions: {
|
||||||
animation: 150,
|
animation: 150,
|
||||||
ghostClass: 'ghost',
|
ghostClass: 'ghost',
|
||||||
|
@ -491,6 +492,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updateBucketPosition(e) {
|
updateBucketPosition(e) {
|
||||||
|
this.dragBucket = false
|
||||||
console.log('drop bucket', e)
|
console.log('drop bucket', e)
|
||||||
},
|
},
|
||||||
setBucketLimit(bucket) {
|
setBucketLimit(bucket) {
|
||||||
|
|
Reference in New Issue