fix that bullshit button

This commit is contained in:
sakrecoer 2026-08-07 11:56:26 +02:00
parent e18ed3f320
commit c3a9df080e
2 changed files with 9 additions and 3 deletions

View file

@ -222,9 +222,10 @@ function renderMusicTracks(tracks, containerId, randomize = false) {
card.className = 'music-card clickable';
card.dataset.playlistIndex = index;
// Click on card opens lightbox
// Click on card opens lightbox (except when clicking on info button)
card.addEventListener('click', function(e) {
if (e.target.closest('audio') || e.target.closest('.lyrics-toggle') || e.target.closest('.lyrics')) {
// Don't trigger if clicking on lyrics-toggle or inside lyrics
if (e.target.closest('.lyrics-toggle') || e.target.closest('.lyrics')) {
return;
}
const idx = parseInt(this.dataset.playlistIndex);
@ -259,6 +260,7 @@ function renderMusicTracks(tracks, containerId, randomize = false) {
content = originalTrack.content || '';
}
// Build the card HTML
let cardHTML = `
<div class="music-card-inner">
<div class="music-image-wrapper">
@ -298,7 +300,10 @@ function initMusicEventListeners() {
});
}
function handleLyricsToggle() {
function handleLyricsToggle(e) {
// Stop the click from bubbling up to the card
e.stopPropagation();
const lyrics = this.nextElementSibling;
if (lyrics && lyrics.classList.contains('lyrics')) {
if (lyrics.style.display === 'none') {