Hide skip button settings when disabled (#321)

* Hide skip button settings when disabled

* let's include everyone
This commit is contained in:
TwistedUmbrellaX 2024-10-03 12:58:12 -04:00 committed by GitHub
parent af2f61b06c
commit e732a71de3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -435,6 +435,8 @@
<input id="ClientList" type="hidden" is="emby-input" />
</details>
<div id="SkipButtonSettings">
<div id="PersistContainer" class="checkboxContainer checkboxContainer-withDescription">
<label class="emby-checkbox-label">
<input id="PersistSkipButton" type="checkbox" is="emby-checkbox" />
@ -470,6 +472,8 @@
</div>
<br />
</div>
<div class="inputContainer">
<label class="inputLabel inputLabelUnfocused" for="RemainingSecondsOfIntro">
Intro playback duration (in seconds)
@ -818,7 +822,9 @@
var windowHashInterval = 0;
var autoSkip = document.querySelector("input#AutoSkip");
var skipButtonVisible = document.getElementById("SkipButtonVisible");
var skipButtonVisibleLabel = document.getElementById("SkipButtonVisibleLabel");
var skipButtonSettings = document.getElementById("SkipButtonSettings");
var selectAllLibraries = document.querySelector("input#SelectAllLibraries");
var librariesContainer = document.querySelector("div.folderAccessListContainer");
var skipFirstEpisode = document.querySelector("div#divSkipFirstEpisode");
@ -829,6 +835,18 @@
var autoSkipCredits = document.querySelector("input#AutoSkipCredits");
var autoSkipCreditsNotificationText = document.querySelector("div#divAutoSkipCreditsNotificationText");
function skipButtonVisibleChanged() {
if (autoSkip.checked && autoSkipCredits.checked) {
skipButtonSettings.style.display = 'none';
} else if (skipButtonVisible.checked) {
skipButtonSettings.style.display = 'unset';
} else {
skipButtonSettings.style.display = 'none';
}
}
skipButtonVisible.addEventListener("change", skipButtonVisibleChanged);
function skipButtonVisibleText() {
if (autoSkip.checked && autoSkipCredits.checked) {
autoSkipClientList.style.display = 'none';
@ -846,6 +864,7 @@
autoSkipClientList.style.width = '100%';
skipButtonVisibleLabel.textContent = "Show skip intro / credit button";
}
skipButtonVisibleChanged()
}
function autoSkipChanged() {
@ -876,6 +895,8 @@
autoSkipCredits.addEventListener("change", autoSkipCreditsChanged);
skipButtonVisibleText(); // run once on launch for legacy installs
function selectAllLibrariesChanged() {
if (selectAllLibraries.checked) {
librariesContainer.style.display = 'none';