diff --git a/src/facilities/fsDecoration.js b/src/facilities/fsDecoration.js index 259399d1e975125b162f507e36f5df4bfae4a2cf..45218f17c5635bddc1a6e8bbb975b6a4c62f95a6 100644 --- a/src/facilities/fsDecoration.js +++ b/src/facilities/fsDecoration.js @@ -81,20 +81,18 @@ App.UI.facilityRedecoration = function() { } select.append(choice); } - const choice = App.UI.DOM.makeElement("option", "Standard"); + const choice = App.UI.DOM.appendNewElement("option", select, "Standard"); + choice.value = "standard"; if (V[variable] === "standard") { choice.selected = true; } - select.append(choice); select.onchange = () => { const O = select.options[select.selectedIndex]; - if (O.value !== "Standard") { + if (O.value !== "standard") { cashX(-5000, "capEx"); - V[variable] = O.value; - } else { - V[variable] = "standard"; } + V[variable] = O.value; App.UI.reload(); }; select.append(option); @@ -107,7 +105,8 @@ App.UI.facilityRedecoration = function() { for (const decorationName of decorationNames) { App.UI.DOM.appendNewElement("option", select, decorationName); } - App.UI.DOM.appendNewElement("option", select, "Standard"); + const standard = App.UI.DOM.appendNewElement("option", select, "Standard"); + standard.value = "standard"; App.UI.DOM.appendNewElement("option", select, "Distribute Evenly"); @@ -125,12 +124,10 @@ App.UI.facilityRedecoration = function() { } } else { for (const decoration of activeFacilities.values()) { - if (O.value !== "Standard") { + if (O.value !== "standard") { cashX(-5000, "capEx"); - V[decoration] = O.value; - } else { - V[decoration] = "standard"; } + V[decoration] = O.value; } } App.UI.reload();