From 6901f75dfba1b12563f69957d8767a0064a4ee8e Mon Sep 17 00:00:00 2001 From: peterino2 Date: Sat, 7 Feb 2026 00:57:59 -0800 Subject: [PATCH] saving --- public/controls.js | 3 +++ public/trackContainer.js | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/public/controls.js b/public/controls.js index f6c50f9..2b665bc 100644 --- a/public/controls.js +++ b/public/controls.js @@ -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); diff --git a/public/trackContainer.js b/public/trackContainer.js index b89d284..7b69299 100644 --- a/public/trackContainer.js +++ b/public/trackContainer.js @@ -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();