Skip to content
Snippets Groups Projects
Commit af107ef5 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

improve the way standard is handled

parent 200e1409
No related branches found
No related tags found
1 merge request!8436Fs pulldown
...@@ -81,20 +81,18 @@ App.UI.facilityRedecoration = function() { ...@@ -81,20 +81,18 @@ App.UI.facilityRedecoration = function() {
} }
select.append(choice); 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") { if (V[variable] === "standard") {
choice.selected = true; choice.selected = true;
} }
select.append(choice);
select.onchange = () => { select.onchange = () => {
const O = select.options[select.selectedIndex]; const O = select.options[select.selectedIndex];
if (O.value !== "Standard") { if (O.value !== "standard") {
cashX(-5000, "capEx"); cashX(-5000, "capEx");
V[variable] = O.value;
} else {
V[variable] = "standard";
} }
V[variable] = O.value;
App.UI.reload(); App.UI.reload();
}; };
select.append(option); select.append(option);
...@@ -107,7 +105,8 @@ App.UI.facilityRedecoration = function() { ...@@ -107,7 +105,8 @@ App.UI.facilityRedecoration = function() {
for (const decorationName of decorationNames) { for (const decorationName of decorationNames) {
App.UI.DOM.appendNewElement("option", select, decorationName); 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"); App.UI.DOM.appendNewElement("option", select, "Distribute Evenly");
...@@ -125,12 +124,10 @@ App.UI.facilityRedecoration = function() { ...@@ -125,12 +124,10 @@ App.UI.facilityRedecoration = function() {
} }
} else { } else {
for (const decoration of activeFacilities.values()) { for (const decoration of activeFacilities.values()) {
if (O.value !== "Standard") { if (O.value !== "standard") {
cashX(-5000, "capEx"); cashX(-5000, "capEx");
V[decoration] = O.value;
} else {
V[decoration] = "standard";
} }
V[decoration] = O.value;
} }
} }
App.UI.reload(); App.UI.reload();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment