diff options
author | 2024-06-13 12:27:55 +0200 | |
---|---|---|
committer | 2024-06-13 20:13:07 -0700 | |
commit | 07f6d397d434f88676da1091a8837933c55bbb29 (patch) | |
tree | 93badd9145d514972c8132ea77349f1b215d8d01 | |
parent | f33e76eb8c2abf4a8f6d94e0bc91e7fbcedc12ee (diff) | |
download | v2-07f6d397d434f88676da1091a8837933c55bbb29.tar.gz v2-07f6d397d434f88676da1091a8837933c55bbb29.tar.zst v2-07f6d397d434f88676da1091a8837933c55bbb29.zip |
Fix Playback speed indicator precision
The original idea was to have two digit precision at all time
in order to ensure the length of the string is always the same.
This prevents the UI button to move when pressed.
I completely missed the first press as the precision was not right
upon first click.
-rw-r--r-- | internal/ui/static/js/bootstrap.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/ui/static/js/bootstrap.js b/internal/ui/static/js/bootstrap.js index d78a9d41..9ae3d0b2 100644 --- a/internal/ui/static/js/bootstrap.js +++ b/internal/ui/static/js/bootstrap.js @@ -172,7 +172,7 @@ document.addEventListener("DOMContentLoaded", () => { // Could not do it backend side because I didn't know how to do it because of the template inclusion and // the way the initial playback speed is handled. See enclosure_media_controls.html if you want to try to fix this document.querySelectorAll(`span.speed-indicator[data-enclosure-id="${element.dataset.enclosureId}"]`).forEach((speedI)=>{ - speedI.innerText = `${element.dataset.playbackRate}x`; + speedI.innerText = `${parseFloat(element.dataset.playbackRate).toFixed(2)}x`; }); } } |