mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Limit slider bubble position to its track
This commit is contained in:
parent
c4824abfb0
commit
e13e6f38d5
@ -227,7 +227,7 @@
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
transform: translate3d(-48%, -120%, 0);
|
||||
transform: translate3d(-50%, -120%, 0);
|
||||
background: #282828;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
|
@ -48,8 +48,13 @@ define(['browser', 'dom', 'layoutManager', 'keyboardnavigation', 'css!./emby-sli
|
||||
function updateBubble(range, value, bubble, bubbleText) {
|
||||
|
||||
requestAnimationFrame(function () {
|
||||
var bubbleTrackRect = range.sliderBubbleTrack.getBoundingClientRect();
|
||||
var bubbleRect = bubble.getBoundingClientRect();
|
||||
|
||||
bubble.style.left = value + '%';
|
||||
var bubblePos = bubbleTrackRect.width * value / 100;
|
||||
bubblePos = Math.min(Math.max(bubblePos, bubbleRect.width / 2), bubbleTrackRect.width - bubbleRect.width / 2);
|
||||
|
||||
bubble.style.left = bubblePos + 'px';
|
||||
|
||||
if (range.getBubbleHtml) {
|
||||
value = range.getBubbleHtml(value);
|
||||
|
Loading…
Reference in New Issue
Block a user