diff --git a/src/css/epicker-ui.css b/src/css/epicker-ui.css index 1f38c93cc..04474b956 100644 --- a/src/css/epicker-ui.css +++ b/src/css/epicker-ui.css @@ -122,7 +122,7 @@ html#ublock0-epicker, border: 0; pointer-events: auto; position: relative; - width: 32%; + width: 40%; } .resultsetModifier > span { align-items: center; @@ -136,12 +136,14 @@ html#ublock0-epicker, border-top-left-radius: 3px; border-bottom-left-radius: 3px; display: inline-block; + flex-shrink: 0; height: 6px; } .resultsetModifier > span > span:nth-of-type(2) { background-color: var(--checkbox-checked-ink); border-radius: 7px; display: inline-block; + flex-shrink: 0; height: 16px; width: 16px; } @@ -150,6 +152,7 @@ html#ublock0-epicker, border-top-right-radius: 2px; border-bottom-right-radius: 2px; display: inline-block; + flex-grow: 1; height: 4px; } .resultsetModifier input { diff --git a/src/js/epicker-ui.js b/src/js/epicker-ui.js index 4e519a280..d062574c0 100644 --- a/src/js/epicker-ui.js +++ b/src/js/epicker-ui.js @@ -91,12 +91,10 @@ const renderRange = function(id, value, invert = false) { const slider = $stor(`#${id} > span`); const lside = slider.children[0]; const thumb = slider.children[1]; - const rside = slider.children[2]; - const thumbWidth = thumb.offsetWidth; - const sliderWidth = slider.offsetWidth - thumbWidth; - const x = value * sliderWidth / max; - lside.style.width = `${x}px`; - rside.style.width = `${sliderWidth - x}px`; + const sliderWidth = slider.offsetWidth; + const maxPercent = (sliderWidth - thumb.offsetWidth) / sliderWidth * 100; + const widthPercent = value / max * maxPercent; + lside.style.width = `${widthPercent}%`; }; /******************************************************************************/