Commit 75d7d551 authored by christianrhansen's avatar christianrhansen

mobile: adding new cell after defining cell size via touch works

parent 69f4103a
Pipeline #16635 passed with stage
in 1 minute and 25 seconds
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
q-icon(name="clear") q-icon(name="clear")
// ------------------------------------------------------------------------------------------------------------ grid // ------------------------------------------------------------------------------------------------------------ grid
@click="event => {addMobileCell(event)}",
div.cell-grid( div.cell-grid(
v-touch-pan="panGrid", v-touch-pan="panGrid",
@click="event => {addMobileCell(event)}",
@dragenter="handleGridDragOver", @dragenter="handleGridDragOver",
@dragover="handleGridDragOver", @dragover="handleGridDragOver",
@dragleave="handleGridDragEnd", @dragleave="handleGridDragEnd",
...@@ -339,6 +339,9 @@ ...@@ -339,6 +339,9 @@
} }
this.mobileTempCell.width = res.x - this.mobileTempCell.x + 1 this.mobileTempCell.width = res.x - this.mobileTempCell.x + 1
this.mobileTempCell.height = res.y - this.mobileTempCell.y + 1 this.mobileTempCell.height = res.y - this.mobileTempCell.y + 1
if (obj.isFinal) {
this.addMobileCell(obj)
}
}, },
async cellHold (event, annotation) { async cellHold (event, annotation) {
this.$store.commit('mosys/setEditingCells', '') this.$store.commit('mosys/setEditingCells', '')
...@@ -371,8 +374,8 @@ ...@@ -371,8 +374,8 @@
*/ */
// console.log('--->>>', this.getGridPositionForEvent(event)) // console.log('--->>>', this.getGridPositionForEvent(event))
}, },
addMobileCell (event, annotation) { addMobileCell (event) {
console.log('addMobileCell()', event, annotation) // console.log('addMobileCell()', event, annotation)
if (this.cachedNewCell) { if (this.cachedNewCell) {
this.handleGridDrop(event) this.handleGridDrop(event)
this.$store.commit('mosys/cacheNewCell', undefined) this.$store.commit('mosys/cacheNewCell', undefined)
...@@ -564,6 +567,8 @@ ...@@ -564,6 +567,8 @@
}]) }])
} }
else { else {
if (this.mobileTempCell.x) console.log('this.mobileTempCell', this.mobileTempCell)
let test = this.grid.get2DArea([this.mobileTempCell.x, this.mobileTempCell.y], [this.mobileTempCell.width, this.mobileTempCell.height])
const const
{ data, config, component } = dropData, { data, config, component } = dropData,
cell = await this.$store.dispatch('cells/post', { data, config, component }) cell = await this.$store.dispatch('cells/post', { data, config, component })
...@@ -575,7 +580,8 @@ ...@@ -575,7 +580,8 @@
id: cell.id id: cell.id
} }
}, },
target: this.grid.get2DArea([x, y], [1, 1]) // target: this.grid.get2DArea([x, y], [1, 1])
target: test
}) })
this.annotations.push(annotation) this.annotations.push(annotation)
this.updateAnnotationUIStates() this.updateAnnotationUIStates()
...@@ -584,6 +590,7 @@ ...@@ -584,6 +590,7 @@
this.tmpObjects = [] this.tmpObjects = []
event.preventDefault() event.preventDefault()
} }
this.mobileTempCell = {x: undefined, y: undefined, width: undefined, height: undefined}
}, },
// //
......
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