Commit 740ff783 authored by Fred Chasen's avatar Fred Chasen
Browse files

Merge branch 'fix-border-undefined' into 'master'

When undefined border is an empty object

See merge request !146
parents e914af20 ea472740
......@@ -761,20 +761,20 @@ class AtPage extends Handler {
addBorderVars(border, list, item) {
// variables for borders
for (let b in border) {
if (typeof border[b] !== "undefined") {
let value = border[b];
let bVar = list.createItem({
for (const name of Object.keys(border)) {
const value = border[name];
// value is an empty object when undefined
if (typeof value === "string") {
const borderItem = list.createItem({
type: "Declaration",
property: "--pagedjs-border-" + b,
property: "--pagedjs-border-" + name,
value: {
type: "Raw",
value: value
}
});
list.append(bVar, item);
list.append(borderItem, item);
}
}
}
......
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