Commit 7be598f2 authored by christianrhansen's avatar christianrhansen
Browse files

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

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