From afa670eadf4497bb165c3ac9b9917228a0482b4d Mon Sep 17 00:00:00 2001 From: enter-a-random-username <112093608+enter-a-random-username@users.noreply.github.com> Date: Thu, 18 Apr 2024 20:52:55 +0200 Subject: [PATCH 1/3] Use % for slider postions --- src/elements/emby-slider/emby-slider.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/elements/emby-slider/emby-slider.js b/src/elements/emby-slider/emby-slider.js index 89db161aad3..585861e6a3d 100644 --- a/src/elements/emby-slider/emby-slider.js +++ b/src/elements/emby-slider/emby-slider.js @@ -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 = valueMarker + '%'; if (valueProgress >= valueMarker) { marker.classList.remove('unwatched'); From 60543a40300a32ea3d9937ac953a7ba3dcfb85e6 Mon Sep 17 00:00:00 2001 From: enter-a-random-username <112093608+enter-a-random-username@users.noreply.github.com> Date: Thu, 18 Apr 2024 21:29:52 +0200 Subject: [PATCH 2/3] Use calc to get the middle of the marker --- src/elements/emby-slider/emby-slider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/emby-slider/emby-slider.js b/src/elements/emby-slider/emby-slider.js index 585861e6a3d..771c81fc9f0 100644 --- a/src/elements/emby-slider/emby-slider.js +++ b/src/elements/emby-slider/emby-slider.js @@ -239,7 +239,7 @@ function setMarker(range, valueMarker, marker, valueProgress) { return; } - marker.style.left = valueMarker + '%'; + marker.style.left = 'calc(' + valueMarker + '% - ' + markerRect.width / 2 + 'px)'; if (valueProgress >= valueMarker) { marker.classList.remove('unwatched'); From f9785ce94135591871f58b1e28273721a00078c1 Mon Sep 17 00:00:00 2001 From: enter-a-random-username <112093608+enter-a-random-username@users.noreply.github.com> Date: Fri, 19 Apr 2024 20:30:59 +0200 Subject: [PATCH 3/3] Update src/elements/emby-slider/emby-slider.js Co-authored-by: Grady Hallenbeck --- src/elements/emby-slider/emby-slider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/emby-slider/emby-slider.js b/src/elements/emby-slider/emby-slider.js index 771c81fc9f0..8c572f64740 100644 --- a/src/elements/emby-slider/emby-slider.js +++ b/src/elements/emby-slider/emby-slider.js @@ -239,7 +239,7 @@ function setMarker(range, valueMarker, marker, valueProgress) { return; } - marker.style.left = 'calc(' + valueMarker + '% - ' + markerRect.width / 2 + 'px)'; + marker.style.left = `calc(${valueMarker}% - ${markerRect.width / 2}px)`; if (valueProgress >= valueMarker) { marker.classList.remove('unwatched');