From af107ef51a1ddaa355bafd0eec14272dcb513264 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 5 Dec 2020 23:52:21 -0500 Subject: [PATCH] improve the way standard is handled --- src/facilities/fsDecoration.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/facilities/fsDecoration.js b/src/facilities/fsDecoration.js index 259399d1e97..45218f17c56 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(); -- GitLab