From 86eecacd377534f652e45c1993d342bc43ba0f79 Mon Sep 17 00:00:00 2001
From: Vasileios Pasialiokis <whiterocket@outlook.com>
Date: Wed, 27 Jun 2018 16:29:39 +0300
Subject: [PATCH] fix leg accessories, input field unfocus events

---
 src/js/DefaultRules.tw          |  2 +-
 src/js/rulesAssistantOptions.tw | 17 ++++++++---------
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw
index 2c9771b7c63..3bdf83d9f78 100644
--- a/src/js/DefaultRules.tw
+++ b/src/js/DefaultRules.tw
@@ -928,7 +928,7 @@ window.DefaultRules = (function() {
 		// Asset Growth 
 		const growth_drugs = new Set(["breast injections", "intensive breast injections", "breast redistributors", "butt injections", "intensive butt injections", "butt redistributors", "lip injections", "lip atrophiers", "penis enhancement", "intensive penis enhancement", "penis atrophiers", "testicle enhancement", "intensive testicle enhancement", "testicle atrophiers", "hyper breast injections", "hyper butt injections", "hyper penis enhancement", "hyper testicle enhancement"]);
 		if ((slave.drugs == "super fertility drugs" || slave.drugs == "fertility drugs") && isFertile(slave)) {
-			r += `<br>slave.slaveName is on slave.drugs and will not be considered for drug enhancement until that regime is complete.`;
+			r += `<br>${slave.slaveName} is on ${slave.drugs} and will not be considered for drug enhancement until that regime is complete.`;
 			return;
 		} else if ((rule.growth_boobs == "no default setting" && rule.growth_butt == "no default setting" && rule.growth_lips == "no default setting" && rule.growth_dick == "no default setting" && rule.growth_dick == "no default setting" && rule.growth_balls == "no default setting")) {
 			return;
diff --git a/src/js/rulesAssistantOptions.tw b/src/js/rulesAssistantOptions.tw
index e9d69104001..f848ceaacf3 100644
--- a/src/js/rulesAssistantOptions.tw
+++ b/src/js/rulesAssistantOptions.tw
@@ -181,7 +181,6 @@ window.rulesAssistantOptions = (function() {
 				value.setAttribute("type", "text");
 				value.classList.add("rajs-value"); // 
 				// call the variable binding when the input field is no longer being edited, and when the enter key is pressed
-				value.onfocusout = () => { this.inputEdited(); };
 				value.onblur = () => {this.inputEdited(); };
 				value.onkeypress = (e) => { if (returnP(e)) this.inputEdited(); };
 			} else {
@@ -477,7 +476,7 @@ window.rulesAssistantOptions = (function() {
 	class RenameField extends Element {
 		constructor(root) {
 			super();
-			this.element.onfocusout = () => changeName(this.element.value, root);
+			this.element.onblur = () => changeName(this.element.value, root);
 			this.element.onkeypress = (e) => { if (returnP(e)) changeName(this.element.value, root); };
 		}
 
@@ -661,7 +660,7 @@ window.rulesAssistantOptions = (function() {
 			min.setAttribute("type", "text");
 			min.value = "" + data.value[0];
 			min.onkeypress = e => { if (returnP(e)) this.setmin(min.value); };
-			min.onfocusout = e => this.setmin(min.value);
+			min.onblur = e => this.setmin(min.value);
 			this.min = min;
 			elem.appendChild(min);
 
@@ -675,7 +674,7 @@ window.rulesAssistantOptions = (function() {
 			max.setAttribute("type", "text");
 			max.value = "" + data.value[1];
 			max.onkeypress = e => { if (returnP(e)) this.setmax(max.value); };
-			max.onfocusout = e => this.setmax(max.value);
+			max.onblur = e => this.setmax(max.value);
 			this.max = max;
 			elem.appendChild(max);
 
@@ -734,7 +733,7 @@ window.rulesAssistantOptions = (function() {
 			input.setAttribute("type", "text");
 			input.value = JSON.stringify(data.value);
 			input.onkeypress = e => { if (returnP(e)) this.setValue(input); };
-			input.onfocusout = e => this.setValue(input);
+			input.onblur = e => this.setValue(input);
 			this.input = input;
 			elem.appendChild(input);
 
@@ -1186,10 +1185,10 @@ window.rulesAssistantOptions = (function() {
 	class LeggingsList extends List {
 		constructor() {
 			const items = [
-				"no default settings",
-				"none",
-				"short stockings",
-				"long stockings",
+				["no default settings"],
+				["none"],
+				["short stockings"],
+				["long stockings"],
 			];
 			super("Leg accessory", items);
 			this.setValue(current_rule.set.legAccessory);
-- 
GitLab