Changeset fa08981 in Klonkt for src/assets/js
- Timestamp:
- 06/20/2026 01:52:46 AM (3 months ago)
- Branches:
- main
- Children:
- 8f6225c
- Parents:
- 230e446
- File:
-
- 1 edited
-
src/assets/js/audio-player.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/assets/js/audio-player.js
r230e446 rfa08981 592 592 const t = queue[currentIndex]; 593 593 const isDesktop = window.matchMedia && window.matchMedia('(min-width: 768px)').matches; 594 if (isDesktop && t && t.postUrl) { goToPost(t.postUrl, t.id); return; } 594 if (isDesktop && t) { 595 // 1) Track speelde vanuit een post → die URL kennen we al. 596 if (t.postUrl) { goToPost(t.postUrl, t.id); return; } 597 // 2) Site-brede track (geen postUrl) → zoek de post op via de track-id. 598 if (t.id) { 599 fetch('/audio/track/' + encodeURIComponent(t.id) + '/post') 600 .then((r) => (r.ok ? r.json() : null)) 601 .then((d) => { if (d && d.url) goToPost(d.url, t.id); else openSheet(); }) 602 .catch(() => openSheet()); 603 return; 604 } 605 } 595 606 openSheet(); 596 607 }); … … 831 842 if (Array.isArray(window.PCMS_SITE_TRACKS) && window.PCMS_SITE_TRACKS.length) { 832 843 queue = window.PCMS_SITE_TRACKS.map(t => ({ 844 id: t.id || null, 833 845 url: t.media_url || t.url, 834 846 title: t.title || 'Untitled',
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)