From 04e8dcbf911478135d87422d367b40d5307ddb0a Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 10 Jul 2021 00:40:55 -0400 Subject: [PATCH] condense down to one div --- src/js/slaveListing.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index c50e278586c..20a74a41a63 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -534,12 +534,12 @@ App.UI.SlaveList.SlaveInteract.penthouseInteract = function(slave) { * @returns {HTMLElement} */ App.UI.SlaveList.sortingLinks = function(passage) { - const outerDiv = document.createElement("div"); + const div = App.UI.DOM.makeElement("div", null, "indent"); const textify = string => capFirstChar(string.replace(/([A-Z])/g, " $1")); - let innerDiv = App.UI.DOM.makeElement("div", "Sort by: ", "indent"); + let span = App.UI.DOM.makeElement("span", "Sort by: "); let order = ["devotion", "trust", "name", "assignment", "seniority", "actualAge", "visualAge", "physicalAge", "weeklyIncome", "health", "weight", "muscles", "intelligence", "sexDrive", "pregnancy"]; - const select = App.UI.DOM.appendNewElement("select", innerDiv); + const select = App.UI.DOM.appendNewElement("select", span); for (const so of order) { const choice = App.UI.DOM.appendNewElement("option", select, textify(so)); choice.value = so; @@ -551,15 +551,15 @@ App.UI.SlaveList.sortingLinks = function(passage) { V.sortSlavesBy = select.options[select.selectedIndex].value; App.UI.reload(); }; - outerDiv.append(innerDiv); + div.append(span); - innerDiv = App.UI.DOM.makeElement("div", "Sort direction: ", "indent"); + span = App.UI.DOM.makeElement("span", " Sort direction: "); order = ["descending", "ascending"]; - innerDiv.append(App.UI.DOM.generateLinksStrip(order.map(so => V.sortSlavesOrder !== so ? + span.append(App.UI.DOM.generateLinksStrip(order.map(so => V.sortSlavesOrder !== so ? App.UI.DOM.passageLink(textify(so), passage, () => { V.sortSlavesOrder = so; }) : textify(so)))); - outerDiv.append(innerDiv); + div.append(span); - return outerDiv; + return div; }; /** -- GitLab