1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Use % for playback slider marker postions (#5394)

* Use % for slider postions

* Use calc to get the middle of the marker

* Update src/elements/emby-slider/emby-slider.js

Co-authored-by: Grady Hallenbeck <grhallenbeck@users.noreply.github.com>

---------

Co-authored-by: Grady Hallenbeck <grhallenbeck@users.noreply.github.com>
This commit is contained in:
enter-a-random-username 2024-06-10 20:53:30 +02:00 committed by GitHub
parent aab373264f
commit ff2ed9aeab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -239,10 +239,7 @@ function setMarker(range, valueMarker, marker, valueProgress) {
return;
}
let markerPos = (bubbleTrackRect.width * valueMarker / 100) - markerRect.width / 2;
markerPos = Math.min(Math.max(markerPos, - markerRect.width / 2), bubbleTrackRect.width - markerRect.width / 2);
marker.style.left = markerPos + 'px';
marker.style.left = `calc(${valueMarker}% - ${markerRect.width / 2}px)`;
if (valueProgress >= valueMarker) {
marker.classList.remove('unwatched');