Fixed a bug where the lyrics sync +/- control disappeared when scrolling

This commit is contained in:
iamdoubz
2026-07-27 15:44:40 -05:00
parent 6be2f16e4a
commit a31df1ab12
2 changed files with 15 additions and 8 deletions
+10 -3
View File
@@ -482,8 +482,9 @@
el.lyricsLines.appendChild(btn);
return { time: l.time, el: btn };
});
if (el.lyricsSync) el.lyricsSync.hidden = false;
if (el.lyrics && !el.lyrics.hidden) startKaraoke();
var panelOpen = el.lyrics && !el.lyrics.hidden;
if (el.lyricsSync) el.lyricsSync.hidden = !panelOpen;
if (panelOpen) startKaraoke();
} else {
el.lyricsLines.textContent = res.lyrics;
}
@@ -498,7 +499,13 @@
var show = el.lyrics.hidden;
el.lyrics.hidden = !show;
el.lyricsToggle.setAttribute('aria-pressed', show ? 'true' : 'false');
if (show && syncedLines.length) startKaraoke(); else stopKaraoke();
if (show && syncedLines.length) {
startKaraoke();
if (el.lyricsSync) el.lyricsSync.hidden = false;
} else {
stopKaraoke();
if (el.lyricsSync) el.lyricsSync.hidden = true;
}
});
}
+5 -5
View File
@@ -28,12 +28,12 @@ $waveActive = radio_waveform_active();
alt="Album art" title="<?= e(cfg('site.name')) ?>"/>
<?php if ($lyricsEnabled): ?>
<button id="lyrics-toggle" class="lyrics-toggle" type="button" hidden aria-pressed="false">Lyrics</button>
<div id="lyrics-sync" class="lyrics-sync" hidden>
<button type="button" data-adj="-0.5" aria-label="Lyrics earlier">&minus;</button>
<span id="lyrics-offset">0.0s</span>
<button type="button" data-adj="0.5" aria-label="Lyrics later">+</button>
</div>
<div id="lyrics" class="lyrics" hidden>
<div id="lyrics-sync" class="lyrics-sync" hidden>
<button type="button" data-adj="-0.5" aria-label="Lyrics earlier">&minus;</button>
<span id="lyrics-offset">0.0s</span>
<button type="button" data-adj="0.5" aria-label="Lyrics later">+</button>
</div>
<div id="lyrics-lines" class="lyrics-lines"></div>
</div>
<?php endif; ?>