Commit bf99c133 authored by anton's avatar anton

Use correct grid configuration object

parent 83852e25
......@@ -292,7 +292,6 @@
return actions
},
gridStyle () {
console.log('DIM', this.gridDimensions)
if (!this.gridDimensions || !this.gridDimensions.full) return {}
// TODO: fix mobile grid editor view
const cell = this.gridDimensions.full.cell
......@@ -1000,19 +999,19 @@
return { x: x, y: y, ox: ox, oy: oy }
},
updateGridDimensions (size) {
const { grid } = this.data
if (!grid || !grid.configuration.value) return
const { configuration } = this.data
if (!configuration) return
let elWidth = size ? size.width : this.$el.offsetWidth
// let elHeight = size ? size.height : this.$el.offsetHeight
let cellSizeRatio = grid.configuration._value.ratio
let cellSizeRatio = configuration.ratio
// let gridHeight = elHeight
let gridHeight = this.$el.offsetHeight
let cellHeight = gridHeight / grid.configuration._value.rows
let cellHeight = gridHeight / configuration.rows
let cellWidth = elWidth / Math.round(elWidth / (cellHeight * cellSizeRatio))
let gridWidth = cellWidth * grid.configuration._value.columns
let gridWidth = cellWidth * configuration.columns
let cellsPerWidth = elWidth / cellWidth
let cellWidthMini = elWidth / grid.configuration._value.columns
let cellWidthMini = elWidth / configuration.columns
let gridHeightMini = cellWidthMini / cellSizeRatio
this.gridDimensions = {
full: {
......@@ -1026,7 +1025,7 @@
},
mini: {
width: elWidth,
height: gridHeightMini * grid.configuration._value.rows,
height: gridHeightMini * configuration.rows,
cell: {
width: cellWidthMini,
height: gridHeightMini
......
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