This commit is contained in:
peterino2 2026-02-07 00:57:59 -08:00
parent 336e5db0be
commit 6901f75dfb
2 changed files with 13 additions and 0 deletions

3
public/controls.js vendored
View File

@ -92,6 +92,9 @@
// Play/pause button
M.$("#status-icon").onclick = togglePlayback;
// Expose jumpToTrack for double-click handling
M.jumpToTrack = jumpToTrack;
// Prev/next buttons
M.$("#btn-prev").onclick = () => jumpToTrack(M.currentIndex - 1);
M.$("#btn-next").onclick = () => jumpToTrack(M.currentIndex + 1);

View File

@ -268,6 +268,16 @@
render();
};
// Double-click - queue: jump to track, library/playlist: add to queue
div.ondblclick = (e) => {
if (e.target.closest('.track-actions')) return;
if (type === 'queue') {
M.jumpToTrack(originalIndex);
} else {
addToQueue([trackId]);
}
};
// Context menu
div.oncontextmenu = (e) => {
e.preventDefault();