Skip to content

Commit

Permalink
Use % for playback slider marker postions (#5394)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
enter-a-random-username and grhallenbeck authored Jun 10, 2024
1 parent aab3732 commit ff2ed9a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/elements/emby-slider/emby-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit ff2ed9a

Please sign in to comment.