From 02cbb8cee36e6c2e8d051bfb1b3386c7a8216101 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sat, 10 Oct 2020 16:29:34 -0400
Subject: [PATCH] preselect

---
 src/markets/specificMarkets/customSlaveMarket.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/markets/specificMarkets/customSlaveMarket.js b/src/markets/specificMarkets/customSlaveMarket.js
index 9a2ba26de97..6fda55a9026 100644
--- a/src/markets/specificMarkets/customSlaveMarket.js
+++ b/src/markets/specificMarkets/customSlaveMarket.js
@@ -80,6 +80,9 @@ App.Markets["Custom Slave"] = function() {
 			const option = document.createElement("option");
 			option.text = `${low + 1}-${high}`;
 			option.value = high;
+			if (slave.age === option.value) {
+				option.selected = true;
+			}
 			select.append(option);
 		}
 		select.onchange = () => {
@@ -308,6 +311,9 @@ App.Markets["Custom Slave"] = function() {
 			const option = document.createElement("option");
 			option.text = text;
 			option.value = value;
+			if (slave.race == option.value) {
+				option.selected = true;
+			}
 			select.append(option);
 		}
 		select.onchange = () => {
@@ -337,7 +343,9 @@ App.Markets["Custom Slave"] = function() {
 	function skin() {
 		const el = document.createElement("div");
 		const slaveProperty = "skin";
-		const choices = new Map;
+		const choices = new Map([
+			["left natural", "Left natural"]
+		]);
 		for (const skin of App.Data.misc.naturalSkins) {
 			choices.set(skin, capFirstChar(skin));
 		}
@@ -350,6 +358,9 @@ App.Markets["Custom Slave"] = function() {
 			const option = document.createElement("option");
 			option.text = text;
 			option.value = value;
+			if (slave.skin == option.value) {
+				option.selected = true;
+			}
 			select.append(option);
 		}
 		select.onchange = () => {
@@ -952,6 +963,9 @@ App.Markets["Custom Slave"] = function() {
 			const option = document.createElement("option");
 			option.text = text;
 			option.value = value;
+			if (slave.nationality === option.value) {
+				option.selected = true;
+			}
 			select.append(option);
 		}
 		select.onchange = () => {
-- 
GitLab