Commit 0de67939 authored by Christian Hansen's avatar Christian Hansen Committed by Anton Koch

add cell on single click (#362)

parent efa34710
......@@ -61,6 +61,7 @@
// ------------------------------------------------------------------------------------------------------------ grid
div.cell-grid.relative-position(
v-touch-pan="panGrid",
@click="event => {clickGrid(event)}",
@contextmenu="handleGridContextMenu",
:style="gridStyle")
......@@ -670,6 +671,19 @@
}
},
*/
clickGrid (event) {
if (!this.cachedNewCell && this.tempCell.onGrid) return
let
tempCell = this.tempCell,
pos = this.getGridPositionForEvent(event)
Object.assign(tempCell, {
x: pos.x,
y: pos.y,
width: 1,
height: 1
})
this.addCell()
},
panGrid (obj) {
if (this.cachedNewCell && !this.tempCell.onGrid) {
let
......
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