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 @@
q-icon(name="clear")
// ------------------------------------------------------------------------------------------------------------ grid
@click="event => {addMobileCell(event)}",
div.cell-grid(
v-touch-pan="panGrid",
@click="event => {addMobileCell(event)}",
@dragenter="handleGridDragOver",
@dragover="handleGridDragOver",
@dragleave="handleGridDragEnd",
......@@ -339,6 +339,9 @@
}
this.mobileTempCell.width = res.x - this.mobileTempCell.x + 1
this.mobileTempCell.height = res.y - this.mobileTempCell.y + 1
if (obj.isFinal) {
this.addMobileCell(obj)
}
},
async cellHold (event, annotation) {
this.$store.commit('mosys/setEditingCells', '')
......@@ -371,8 +374,8 @@
*/
// console.log('--->>>', this.getGridPositionForEvent(event))
},
addMobileCell (event, annotation) {
console.log('addMobileCell()', event, annotation)
addMobileCell (event) {
// console.log('addMobileCell()', event, annotation)
if (this.cachedNewCell) {
this.handleGridDrop(event)
this.$store.commit('mosys/cacheNewCell', undefined)
......@@ -564,6 +567,8 @@
}])
}
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
{ data, config, component } = dropData,
cell = await this.$store.dispatch('cells/post', { data, config, component })
......@@ -575,7 +580,8 @@
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.updateAnnotationUIStates()
......@@ -584,6 +590,7 @@
this.tmpObjects = []
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