/* ── the queue, dragged ─────────────────────────────────────────── The same gesture the playlist page has (./reorder.js). Press and release without moving and the row's sheet opens exactly as the long press always opened it — which matters more here than anywhere: a queue row has no ⋯, so that sheet is the only door to Play now, Move to next and Remove from queue. */ let qiAt = -1; function queueLift() { qiAt = player.qi; } function queueDrop(from, to) { /* a track boundary crossed mid-drag moves the whole rendered window, and these are absolute indices: they would address the wrong rows. Drop nothing rather than the wrong thing. */ if (player.qi !== qiAt) return; moveInQueue(qiAt + 1 + from, qiAt + 1 + to); } function queueHold(k) { const i = player.qi + 1 + k; const e = player.queue[i]; if (e) openHalf("track", { album: e.album, track: e.t, queueIndex: i }); } const queueDrag = { enabled: true, rowSel: ".row", scrollSel: ".np-face", onLift: queueLift, onDrop: queueDrop, onHold: queueHold };