Fix issues with support for touch-devices

This commit is contained in:
Jan Oberhauser
2020-10-23 18:15:52 +02:00
parent e48c9b2dc0
commit c40601eecb
3 changed files with 26 additions and 15 deletions

View File

@@ -7,7 +7,7 @@
@touchend="mouseUp"
@touchmove="mouseMoveNodeWorkflow"
@mousedown="mouseDown"
v-touch:tap="mouseDown"
v-touch:tap="touchTap"
@mouseup="mouseUp"
@wheel="wheelScroll"
>
@@ -340,9 +340,12 @@ export default mixins(
await this.addNodes(data.nodes, data.connections);
},
touchTap (e: MouseEvent | TouchEvent) {
if (this.isTouchDevice) {
this.mouseDown(e);
}
},
mouseDown (e: MouseEvent | TouchEvent) {
console.log('mouseDown');
// Save the location of the mouse click
const position = this.getMousePosition(e);
const offsetPosition = this.$store.getters.getNodeViewOffsetPosition;