From deb8338de32af3003911112e7fab048287a5e5ad Mon Sep 17 00:00:00 2001 From: 00Fjongl <65314359+00Fjongl@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:05:32 -0500 Subject: [PATCH] Code cleanup; removed roundabout JS implementation of settings menu's open and close buttons. --- views/assets/css/styles-1644738239.css | 3 +-- views/assets/js/common-16451543478.js | 2 +- views/assets/js/csel.js | 3 +++ views/pages/misc/deobf/header.html | 30 ++------------------------ 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/views/assets/css/styles-1644738239.css b/views/assets/css/styles-1644738239.css index 3225b516..098561bd 100644 --- a/views/assets/css/styles-1644738239.css +++ b/views/assets/css/styles-1644738239.css @@ -423,7 +423,6 @@ details[open] summary { z-index: 5; /* Ensures it appears above other content */ align-items: center; justify-content: center; - display: none; /* Flexbox to center content */ } .settings-content { @@ -437,7 +436,7 @@ details[open] summary { text-align: center; } -.dropdown-parent:focus-within .dropdown-settings { +.dropdown-parent:focus-within .dropdown-settings:not(:is(:has(.close-settings-btn:active))) { display: flex; /* Flexbox to center content */ } diff --git a/views/assets/js/common-16451543478.js b/views/assets/js/common-16451543478.js index 226b55d4..b9f4264b 100644 --- a/views/assets/js/common-16451543478.js +++ b/views/assets/js/common-16451543478.js @@ -471,7 +471,7 @@ addEventListener("DOMContentLoaded", () => { // Which function is used for the click event is determined by // the corresponding location/index in the dirnames object. - let functionsList = [ + const functionsList = [ () => goFrame(item.path), () => goFrame("/?eg&core=" + item.core + "&rom=" + item.rom), () => item.custom ? goProx[item.custom]("stealth") : goFrame("/archive/g/" + item.path) diff --git a/views/assets/js/csel.js b/views/assets/js/csel.js index a4c1089f..d4f59f0a 100644 --- a/views/assets/js/csel.js +++ b/views/assets/js/csel.js @@ -67,6 +67,9 @@ readCookie("HBHideAds").then(s => (s != "false") ? pageHideAds() : pageShowAds(( // All code below is used by the Settings UI in the navigation bar. if (document.getElementById("csel")) { + let closeBtn = document.querySelector(".dropdown-settings .close-settings-btn"); + closeBtn.addEventListener("click", () => {document.activeElement.blur()}); + // Allow users to set a custom title with the UI. let titleform = document.getElementById("titleform"); titleform.addEventListener("submit", e => { diff --git a/views/pages/misc/deobf/header.html b/views/pages/misc/deobf/header.html index 51bdeb33..58c2c270 100644 --- a/views/pages/misc/deobf/header.html +++ b/views/pages/misc/deobf/header.html @@ -32,7 +32,7 @@ -