Changeset 5258945 in Klonkt for src/assets/js
- Timestamp:
- 06/20/2026 02:17:12 AM (3 months ago)
- Branches:
- main
- Children:
- 795c925
- Parents:
- ddf549f
- File:
-
- 1 edited
-
src/assets/js/audio-player.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/audio-player.js
rddf549f r5258945 276 276 // Used by the site pre-seed so opening a page doesn't auto-download audio; 277 277 // the blob is fetched lazily on the first play(). 278 // Markeer de huidige track persistent (blijvende highlight zolang 'ie actief is). 279 function markPlaying(trackId) { 280 document.querySelectorAll('.pat-playing').forEach((e) => e.classList.remove('pat-playing')); 281 if (!trackId) return; 282 const el = document.getElementById('track-' + trackId); 283 if (el) el.classList.add('pat-playing'); 284 } 285 // Na een htmx-navigatie is de post-DOM vervangen → highlight opnieuw zetten. 286 document.body.addEventListener('htmx:afterSettle', () => { 287 const t = queue[currentIndex]; 288 if (t) markPlaying(t.id); 289 }); 290 278 291 function loadTrack(index, autoplay, metaOnly) { 279 292 if (!queue[index]) { … … 300 313 document.body.classList.add('has-audio-player'); 301 314 renderQueue(); 315 markPlaying(t.id); 302 316 303 317 if (metaOnly) return;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)