Commit e4f2ca1d authored by christianrhansen's avatar christianrhansen

mobile: prevent cell shifting when holding cell to copy it

parent b1dabdf1
......@@ -780,22 +780,26 @@
},
handleCellDragStart (event, annotation) {
console.log('§§§§§§§§', annotation)
if (!this.annotationUIStates[annotation._uuid].beingResized) {
event.dataTransfer.setData('text/plain', JSON.stringify(annotation))
event.dataTransfer.setDragImage(nullImage, 0, 0)
let elContainerBoundingBox = this.$el.getBoundingClientRect()
let elBoundingBox = event.target.getBoundingClientRect()
let offset = {
x: (event.clientX - elContainerBoundingBox.x) - (elBoundingBox.x - elContainerBoundingBox.x),
y: (event.clientY - elContainerBoundingBox.y) - (elBoundingBox.y - elContainerBoundingBox.y)
if (!this.isMobile) {
if (!this.annotationUIStates[annotation._uuid].beingResized) {
event.dataTransfer.setData('text/plain', JSON.stringify(annotation))
event.dataTransfer.setDragImage(nullImage, 0, 0)
let elContainerBoundingBox = this.$el.getBoundingClientRect()
let elBoundingBox = event.target.getBoundingClientRect()
let offset = {
x: (event.clientX - elContainerBoundingBox.x) - (elBoundingBox.x - elContainerBoundingBox.x),
y: (event.clientY - elContainerBoundingBox.y) - (elBoundingBox.y - elContainerBoundingBox.y)
}
this.annotationUIStates[annotation._uuid].draggingOffset = offset
this.annotationUIStates[annotation._uuid].beingDragged = true
}
this.annotationUIStates[annotation._uuid].draggingOffset = offset
this.annotationUIStates[annotation._uuid].beingDragged = true
this.tmpObjects.push(annotation)
}
this.tmpObjects.push(annotation)
},
handleCellDragEnd (event, annotation) {
this.annotationUIStates[annotation._uuid].beingDragged = false
if (!this.mobile) {
this.annotationUIStates[annotation._uuid].beingDragged = false
}
},
async handleCellContextMenuDelete (event, annotation) {
this.annotationUIStates[annotation._uuid].selected = false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment