From bf3fe4e9fcdd37af3cf46adfeab46e8e448072f1 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Wed, 19 Feb 2020 23:08:43 -0500
Subject: [PATCH] fix separator

---
 src/js/wardrobeUse.js | 50 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/src/js/wardrobeUse.js b/src/js/wardrobeUse.js
index 77998c611fc..98f74851562 100644
--- a/src/js/wardrobeUse.js
+++ b/src/js/wardrobeUse.js
@@ -200,26 +200,6 @@ App.UI.Wardrobe.shoes = function(slave) {
 			he, him, his, hers, himself, boy, He, His
 		} = getPronouns(slave);
 
-	let choiceOptionsArray = [];
-	choiceOptionsArray.push({text: `None`, updateSlave: {shoes: `none`}});
-
-	let optionsArray = [];
-
-	let clothingOption;
-	App.Data.misc.shoes.forEach(item => {
-		clothingOption = {
-			text: item.name,
-			updateSlave: {shoes: item.value}
-		};
-		if (item.fs) {
-			clothingOption.FS = item.fs;
-		}
-		optionsArray.push(clothingOption);
-	});
-
-	// Sort
-	optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
-
 	let el = document.createElement('div');
 
 	let label = document.createElement('div');
@@ -233,11 +213,30 @@ App.UI.Wardrobe.shoes = function(slave) {
 	/* We have "barefoot" in App.Data.Misc to cover for this
 	// Choose her own
 	if (slave.shoes !== `none`) {
+		let choiceOptionsArray = [];
+		choiceOptionsArray.push({text: `None`, updateSlave: {shoes: `none`}});
 		label.appendChild(App.UI.Wardrobe.generateRows(choiceOptionsArray, "shoes", slave, false));
 	}
 	*/
 	el.appendChild(label);
 
+	let optionsArray = [];
+
+	let clothingOption;
+	App.Data.misc.shoes.forEach(item => {
+		clothingOption = {
+			text: item.name,
+			updateSlave: {shoes: item.value}
+		};
+		if (item.fs) {
+			clothingOption.FS = item.fs;
+		}
+		optionsArray.push(clothingOption);
+	});
+
+	// Sort
+	// No sort here since we want light -> advanced.  optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
+
 	// Options
 	let links = document.createElement('div');
 	links.className = "choices";
@@ -321,7 +320,7 @@ App.UI.Wardrobe.bellyAccessory = function(slave) {
 		}
 	});
 	// Sort
-	optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
+	// No sort here since we want small -> large.optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
 
 	let el = document.createElement('div');
 
@@ -396,7 +395,7 @@ App.UI.Wardrobe.buttplug = function(slave) {
 	});
 
 	// Sort
-	optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
+	// No sort here since we want small -> large.  optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1);
 
 	// Options
 	let links = document.createElement('div');
@@ -490,8 +489,10 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, accessCheck=fals
 		if (accessCheck === true) {
 			unlocked = isClothingAccessible.entry(array[i].updateSlave[category], `${category}`, slave, true);
 		}
-		console.log(category, unlocked);
 		if (accessCheck === false || unlocked) {
+			if (i < array.length && i !== 0) { // start with separator (after first loop); can't after since the last loop may not have any text.
+				row.appendChild(separator);
+			}
 			// is it just text?
 			if (array[i].disabled) {
 				link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]);
@@ -525,9 +526,6 @@ App.UI.Wardrobe.generateRows = function(array, category, slave, accessCheck=fals
 				}
 			}
 			row.appendChild(link);
-			if (i < array.length-1) {
-				row.appendChild(separator);
-			}
 		}
 	}
 
-- 
GitLab