active modal adjustments
This commit is contained in:
parent
aad6eb7da6
commit
c9704764ae
2 changed files with 15 additions and 14 deletions
|
|
@ -1449,8 +1449,8 @@ function renderSpotifyPlaylists() {
|
||||||
<div class="sync-progress-indicator" id="progress-${p.id}"></div>
|
<div class="sync-progress-indicator" id="progress-${p.id}"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="playlist-card-actions">
|
<div class="playlist-card-actions">
|
||||||
<button id="action-btn-${p.id}" onclick="handleCardActionClick(event, '${p.id}')">Sync / Download</button>
|
<button id="action-btn-${p.id}" onclick="openPlaylistDetailsModal(event, '${p.id}')">Sync / Download</button>
|
||||||
<button id="progress-btn-${p.id}" class="view-progress-btn hidden" onclick="handleCardActionClick(event, '${p.id}')">
|
<button id="progress-btn-${p.id}" class="view-progress-btn hidden" onclick="handleViewProgressClick(event, '${p.id}')">
|
||||||
View Progress
|
View Progress
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1460,34 +1460,28 @@ function renderSpotifyPlaylists() {
|
||||||
}).join('');
|
}).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCardActionClick(event, playlistId) {
|
function handleViewProgressClick(event, playlistId) {
|
||||||
event.stopPropagation();
|
event.stopPropagation(); // Prevent the card selection from toggling
|
||||||
const process = activeDownloadProcesses[playlistId];
|
const process = activeDownloadProcesses[playlistId];
|
||||||
|
|
||||||
if (process && process.modalElement) {
|
if (process && process.modalElement) {
|
||||||
// If a process is active, show its modal
|
// If a process is active, just show its modal
|
||||||
console.log(`Re-opening active download modal for playlist ${playlistId}`);
|
console.log(`Re-opening active download modal for playlist ${playlistId}`);
|
||||||
process.modalElement.style.display = 'flex';
|
process.modalElement.style.display = 'flex';
|
||||||
} else {
|
|
||||||
// Otherwise, open the details modal as normal
|
|
||||||
openPlaylistDetailsModal(event, playlistId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePlaylistCardUI(playlistId) {
|
function updatePlaylistCardUI(playlistId) {
|
||||||
const process = activeDownloadProcesses[playlistId];
|
const process = activeDownloadProcesses[playlistId];
|
||||||
const defaultBtn = document.getElementById(`action-btn-${playlistId}`);
|
|
||||||
const progressBtn = document.getElementById(`progress-btn-${playlistId}`);
|
const progressBtn = document.getElementById(`progress-btn-${playlistId}`);
|
||||||
|
|
||||||
if (!defaultBtn || !progressBtn) return;
|
if (!progressBtn) return;
|
||||||
|
|
||||||
if (process && process.status === 'running') {
|
if (process && process.status === 'running') {
|
||||||
// A process is running: show progress button, hide default
|
// A process is running: show the progress button
|
||||||
defaultBtn.classList.add('hidden');
|
|
||||||
progressBtn.classList.remove('hidden');
|
progressBtn.classList.remove('hidden');
|
||||||
} else {
|
} else {
|
||||||
// No process or it's finished: show default, hide progress
|
// No process or it's finished: hide the progress button
|
||||||
defaultBtn.classList.remove('hidden');
|
|
||||||
progressBtn.classList.add('hidden');
|
progressBtn.classList.add('hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -3539,6 +3533,8 @@ window.closeDownloadMissingModal = closeDownloadMissingModal;
|
||||||
window.startTrackAnalysis = startTrackAnalysis;
|
window.startTrackAnalysis = startTrackAnalysis;
|
||||||
window.cancelAllOperations = cancelAllOperations;
|
window.cancelAllOperations = cancelAllOperations;
|
||||||
window.cancelTrackDownload = cancelTrackDownload;
|
window.cancelTrackDownload = cancelTrackDownload;
|
||||||
|
window.handleViewProgressClick = handleViewProgressClick;
|
||||||
|
|
||||||
|
|
||||||
// APPEND THIS JAVASCRIPT SNIPPET (B)
|
// APPEND THIS JAVASCRIPT SNIPPET (B)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4964,6 +4964,11 @@ body {
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.playlist-card-actions .view-progress-btn {
|
||||||
|
background: #1db954;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
.playlist-card-actions button:hover {
|
.playlist-card-actions button:hover {
|
||||||
background: #1db954;
|
background: #1db954;
|
||||||
color: #000000;
|
color: #000000;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue