fx-compat: Scaffold: Fix "undefined" attributes

This commit is contained in:
Abe Jellinek 2022-07-19 14:43:24 -04:00
parent db3aa5248c
commit 14f79018ad

View file

@ -1630,8 +1630,8 @@ var Scaffold = new function () {
function wrapWithHBox(elem, { flex = undefined, width = undefined } = {}) { function wrapWithHBox(elem, { flex = undefined, width = undefined } = {}) {
let hbox = document.createXULElement('hbox'); let hbox = document.createXULElement('hbox');
hbox.append(elem); hbox.append(elem);
hbox.setAttribute('flex', flex); if (flex !== undefined) hbox.setAttribute('flex', flex);
hbox.setAttribute('width', width); if (width !== undefined) hbox.setAttribute('width', width);
return hbox; return hbox;
} }
@ -1685,7 +1685,7 @@ var Scaffold = new function () {
let defer = document.createXULElement('checkbox'); let defer = document.createXULElement('checkbox');
defer.checked = test.defer; defer.checked = test.defer;
defer.disabled = true; defer.disabled = true;
hbox.appendChild(wrapWithHBox(defer)); hbox.appendChild(wrapWithHBox(defer, { width: 30 }));
item.appendChild(hbox); item.appendChild(hbox);