(cx)
| 814 | const rect = bars.getBoundingClientRect(); |
| 815 | const head = bars.querySelector(".playhead"); |
| 816 | const seek = (cx) => { |
| 817 | const frac = Math.max(0, Math.min(1, (cx - rect.left) / rect.width)); |
| 818 | if (head) head.style.left = frac * 100 + "%"; |
| 819 | const cur = app.querySelector(".wave-times .cur"); |
| 820 | if (cur) cur.textContent = fmt(frac * curDuration()); |
| 821 | state.progress = frac; |
| 822 | paintWaveProgress(); |
| 823 | seekToFraction(frac); |
| 824 | }; |
| 825 | seek(e.clientX); |
| 826 | bars.setPointerCapture(e.pointerId); |
| 827 | const mv = (ev) => seek(ev.clientX); |
no test coverage detected