Commit fbca08fc authored by Anton Koch's avatar Anton Koch

Merge branch '362-add-click-handler-to-temp-cell---mosys' into 'master'

add cell on single click (#362)

See merge request !34
parents 311033ae 0de67939
Pipeline #51567 passed with stage
in 4 minutes and 38 seconds
......@@ -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