mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 09:04:28 +00:00
refactor(Dashboard touch events): allows to scroll on mobile over widgets, fixes dragging bug on mobile
This commit is contained in:
@@ -64,19 +64,25 @@ export default {
|
||||
this.registerDragAction(event);
|
||||
this.tryDragStart(event, this.item);
|
||||
},
|
||||
touchMove(event){
|
||||
if(this.dragging){
|
||||
event.preventDefault();
|
||||
this.$emit('dragging', event);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
template: `
|
||||
<div class="drop-grid-item"
|
||||
@mousedown="registerDragAction"
|
||||
@mouseup="$emit('mouseUp', $event)"
|
||||
@touchstart.prevent="touchStart"
|
||||
@touchstart="touchStart"
|
||||
@touchend="touchDragEnd"
|
||||
@dragstart="tryDragStart($event, item)"
|
||||
@drag="$emit('dragging',$event)"
|
||||
@touchmove.prevent="$emit('dragging',$event)"
|
||||
@dragend="$emit('endDrag', $event)"
|
||||
:draggable="active && !item.placeholder && dragAction != ''">
|
||||
@touchmove="touchMove"
|
||||
@dragend="$emit('endDrag', $event); dragging = false"
|
||||
:draggable="active && !item.placeholder && dragging">
|
||||
<slot v-bind="item"></slot>
|
||||
</div>`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user