Commit 7be598f2 authored by christianrhansen's avatar christianrhansen

mobile: "move cell"-button positioning: started from scratch

parent ed19847c
......@@ -144,11 +144,12 @@
//----- resize handler (top left)
// :style="{left: resizeHandler.topLeft.x - 20 + 'px', top: resizeHandler.topLeft.y - 20 + 'px'}")
.resize-handler-mobile.top-left.fixed.text-dark.justify-center.row.bg-white.shadow-6(
.resize-handler-mobile.top-left.absolute.text-dark.justify-center.row.bg-white.shadow-6(
v-if="mobileTempCell.onGrid",
v-touch-pan="handleTopLeft", round, flat,
:class="{'pushed': !resizeHandler.topLeft.pushed}",
:style="setHandlerStyle()")
:style="{left: resizeHandler.topLeft.x - 20 + 'px', top: resizeHandler.topLeft.y - 20 + 'px'}",
:class="{'pushed': !resizeHandler.topLeft.pushed}")
//:style="setHandlerStyle()")
// q-icon.self-center.rotate-180(name="signal_cellular_4_bar", size="12px", style="margin-top: 2px;")
q-icon.self-center.rotate-180(name="open_with", size="22px")
......@@ -314,7 +315,7 @@
// cursor: {x: undefined, y: undefined},
resizeHandler: {
size: {width: 40, height: 40},
topLeft: {x: undefined, y: undefined, pushed: false, pos: undefined},
topLeft: {x: 20, y: undefined, pushed: false, pos: undefined},
bottomRight: {x: undefined, y: undefined, pushed: false, pos: undefined}
}
}
......@@ -372,6 +373,7 @@
async mounted () {
await this.fetchData()
this.resetScrollPosition()
/*
let options = {
rootMargin: '0px',
......@@ -387,6 +389,7 @@
let observer = new IntersectionObserver(this.observerCallback, options)
observer.observe(this.$refs._mobileTempCell)
this.observer = observer
*/
},
beforeDestroy () {
this.observer.disconnect()
......@@ -496,13 +499,17 @@
this.mobileTempCell.ox = res.ox
this.mobileTempCell.oy = res.oy
this.resizeHandler.topLeft.y = res.y * this.gridDimensions.full.cell.height
this.resizeHandler.topLeft.x = res.ox
this.resizeHandler.topLeft.y = res.oy
if (obj.isFinal) {
this.mobileTempCell.onGrid = true
this.mobileTempCell.button = true
this.resizeHandler.topLeft.pushed = false
this.mobileTempCell.left = this.gridDimensions.full.cell.width * (res.x - 1)
this.resizeHandler.topLeft.pushed = false
// this.resizeHandler.topLeft.y = this.gridDimensions.full.cell.height * (res.y - 1) + 8 + 59 + 20
this.resizeHandler.topLeft.x = this.gridDimensions.full.cell.width * (this.mobileTempCell.x - 1) + 8 + 20
this.resizeHandler.topLeft.y = this.gridDimensions.full.cell.height * (this.mobileTempCell.y - 1) + 8 + 20
}
},
testButton (obj) {
......@@ -572,6 +579,8 @@
this.mobileTempCell.button = true
// this.addMobileCell(obj)
// this.mobileTempCell.show = false
this.resizeHandler.topLeft.x = this.gridDimensions.full.cell.width * (this.mobileTempCell.x - 1) + 8 + 20
this.resizeHandler.topLeft.y = this.gridDimensions.full.cell.height * (this.mobileTempCell.y - 1) + 8 + 20
}
}
},
......
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