diff --git a/partials/GridEditor.vue b/partials/GridEditor.vue index a6556643aab2faf53dc68de146edb30b079bef36..caac5802522b3829775c554c7344d9262d9028b5 100644 --- a/partials/GridEditor.vue +++ b/partials/GridEditor.vue @@ -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} }, //