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