Only add a drag delay if on mobile instead of setting it to 0

This commit is contained in:
kolaente 2021-08-03 23:26:39 +02:00
parent 7792cdf8bd
commit e3787b9496
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -16,7 +16,8 @@
v-model="params"
/>
</div>
<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
v-model="buckets"
@start="() => dragBucket = true"
@ -26,7 +27,8 @@
:disabled="!canWrite"
:class="{'dragging-disabled': !canWrite}"
>
<transition-group type="transition" :name="!dragBucket ? '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
:key="`bucket${bucket.id}`"
class="bucket"
@ -254,12 +256,6 @@ export default {
return {
drag: false,
dragBucket: false,
dragOptions: {
animation: 150,
ghostClass: 'ghost',
dragClass: 'task-dragging',
delay: isTouchDevice() ? 150 : 0,
},
sourceBucket: 0,
showBucketDeleteModal: false,
@ -310,6 +306,19 @@ export default {
this.$store.commit('kanban/setBuckets', value)
},
},
dragOptions() {
const options = {
animation: 150,
ghostClass: 'ghost',
dragClass: 'task-dragging',
}
if (isTouchDevice()) {
options.delay = 150
}
return options
},
...mapState({
loadedListId: state => state.kanban.listId,
loading: state => state[LOADING] && state[LOADING_MODULE] === 'kanban',