From 1c1ad74b0820b6be1400e882127813d93af79ec7 Mon Sep 17 00:00:00 2001
From: ezsh <ezsh.junk@gmail.com>
Date: Mon, 1 Jun 2020 18:50:37 +0200
Subject: [PATCH] Print age via makeSpan() in slav summary

---
 src/js/slaveSummaryHelpers.js | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/js/slaveSummaryHelpers.js b/src/js/slaveSummaryHelpers.js
index eb8067abc07..55daa7b5cc9 100644
--- a/src/js/slaveSummaryHelpers.js
+++ b/src/js/slaveSummaryHelpers.js
@@ -449,22 +449,18 @@ App.UI.SlaveSummaryImpl = function() {
 		 * @returns {void}
 		 */
 		function long_age(slave, c) {
-			let r = makeSpan(c, "", "pink");
-			if (V.showAgeDetail === 1) {
-				r.textContent += `Age ` + `${slave.actualAge}` + `.`;
-			} else {
-				r.textContent +=  helpers.getNumericRating(data.long.body.age, slave.actualAge);
-			}
+			const style = "pink";
+			makeSpan(c, V.showAgeDetail ? `Age ${slave.actualAge}` : helpers.getNumericRating(data.long.body.age, slave.actualAge), style, true);
 			/*
 			 ** No NCS, then do the standard, However because of the wrinkles of Incubators, as long as visual age is greater
 			 ** than or equal to physical age, we do the old physical body/Looks for fresh out of the can NCS slaves.
 			 */
 			if (((slave.geneMods.NCS === 0) || (slave.visualAge >= slave.physicalAge))) {
 				if (slave.actualAge !== slave.physicalAge) {
-					r.textContent += ` ${slave.physicalAge}` + ` year old body.`;
+					makeSpan(c, `${slave.physicalAge} year old body`, style, true);
 				}
 				if (slave.visualAge !== slave.physicalAge) {
-					r.textContent += ` Looks ` + `${slave.visualAge}` + `.`;
+					makeSpan(c, `Looks ${slave.visualAge}`, style, true);
 				}
 			} else {
 				/*
@@ -476,10 +472,10 @@ App.UI.SlaveSummaryImpl = function() {
 				 ** say: 'Age 1. 11 year old body.' -- this conflicts with the way NCS works though, because she hasn't
 				 ** visually aged, so our change here makes it say 'Age 1. Appears to have a 10 year old body.'
 				 */
-				r.textContent += ` Appears to have a ` + `${slave.visualAge}` + ` year old body.`;
+				makeSpan(c, `Appears to have a ${slave.visualAge} year old body`, style, true);
 			}
 			if (slave.geneMods.NCS === 1) {
-				makeSpan(r, "NCS", "orange");
+				makeSpan(c, "NCS", "orange");
 			}
 		}
 
@@ -490,7 +486,7 @@ App.UI.SlaveSummaryImpl = function() {
 		 */
 		function long_face(slave, c) {
 			const r = helpers.getNumericRating(data.long.body.face, slave.face + 100);
-			makeSpan(c, ` ${r.desc} ${slave.faceShape} face`, r.style, true, slave.face);
+			makeSpan(c, `${r.desc} ${slave.faceShape} face`, r.style, true, slave.face);
 		}
 
 		/**
-- 
GitLab