From 9e95f5b28315fd621c3b6f57cd4a65b67501e33b Mon Sep 17 00:00:00 2001 From: "cool.gitter.choco" Date: Sat, 1 Feb 2025 21:33:15 -0600 Subject: [PATCH] Only remove button when downloading --- static/js/app.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index dcbb448..c4360a7 100755 --- a/static/js/app.js +++ b/static/js/app.js @@ -233,17 +233,28 @@ function performSearch() { e.stopPropagation(); const url = e.currentTarget.dataset.url; const type = e.currentTarget.dataset.type; - const albumType = e.currentTarget.dataset.albumType; // for artist downloads + const albumType = e.currentTarget.dataset.albumType; + + // Check if the clicked button is the main download button + const isMainButton = e.currentTarget.classList.contains('main-download'); + + if (isMainButton) { + // Remove the entire card for main download button + card.remove(); + } else { + // Only remove the clicked specific button + e.currentTarget.remove(); + } + startDownload(url, type, items[index], albumType); - card.remove(); }); }); - }); + }); }) .catch(error => showError(error.message)); } - +H function createResultCard(item, type) { let imageUrl, title, subtitle, details;