From 8c8b8ead08ceb53eaa5d64c18c638d9384babeef Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX Date: Fri, 1 Mar 2024 14:45:27 -0500 Subject: [PATCH] Hide unused settings when unused --- .../Configuration/configPage.html | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html index c47b763..fca3706 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Configuration/configPage.html @@ -246,7 +246,7 @@
@@ -503,6 +503,23 @@ var windowHashInterval = 0; + var persistSkip = document.querySelector("input#PersistSkipButton"); + var showAdjustment = document.querySelector("input#ShowPromptAdjustment"); + var hideAdjustment = document.querySelector("input#HidePromptAdjustment"); + + // prevent setting unavailable options + async function persistSkipChanged() { + if (persistSkip.checked) { + showAdjustment.style.display = 'none'; + hideAdjustment.style.display = 'none'; + } else { + showAdjustment.style.display = 'block'; + hideAdjustment.style.display = 'block'; + } + } + + persistSkip.addEventListener("change", persistSkipChanged); + // when the fingerprint visualizer opens, populate show names async function visualizerToggled() { if (!visualizer.open) { @@ -781,6 +798,8 @@ document.querySelector("#" + field).checked = config[field]; } + persistSkipChanged(); + Dashboard.hideLoadingMsg(); }); });