Commit 0be1f642 authored by anton's avatar anton

Verify input for getCellStyle function

parent b307d343
Pipeline #59601 passed with stage
in 6 minutes and 31 seconds
......@@ -1247,22 +1247,26 @@
}
},
getCellStyle (obj) {
let x, y, w, h
if (!obj) return {}
let x = 0, y = 0, w = 0, h = 0
// ----- existing cell
if (obj.id) {
if (obj.id && obj.target && obj.target.selector) {
const parsed = obj.target.selector._value
x = parsed.xywh[0]
y = parsed.xywh[1]
w = parsed.xywh[2]
h = parsed.xywh[3]
if (Array.isArray(parsed.xywh) && parsed.xywh.length === 4) {
x = parsed.xywh[0]
y = parsed.xywh[1]
w = parsed.xywh[2]
h = parsed.xywh[3]
}
}
// ----- temp cell
else {
x = obj.x
y = obj.y
w = obj.width
h = obj.height
x = obj.x || x
y = obj.y || y
w = obj.width || w
h = obj.height || h
}
return {
'grid-column-start': x,
......
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