mirror of https://github.com/gorhill/uBlock.git
Fix slider's responsiveness to layout changes
Related commit:
- f01bda1159
This commit is contained in:
parent
e2a22f5b77
commit
b73b24ebb1
|
@ -122,7 +122,7 @@ html#ublock0-epicker,
|
||||||
border: 0;
|
border: 0;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 32%;
|
width: 40%;
|
||||||
}
|
}
|
||||||
.resultsetModifier > span {
|
.resultsetModifier > span {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -136,12 +136,14 @@ html#ublock0-epicker,
|
||||||
border-top-left-radius: 3px;
|
border-top-left-radius: 3px;
|
||||||
border-bottom-left-radius: 3px;
|
border-bottom-left-radius: 3px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
flex-shrink: 0;
|
||||||
height: 6px;
|
height: 6px;
|
||||||
}
|
}
|
||||||
.resultsetModifier > span > span:nth-of-type(2) {
|
.resultsetModifier > span > span:nth-of-type(2) {
|
||||||
background-color: var(--checkbox-checked-ink);
|
background-color: var(--checkbox-checked-ink);
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
flex-shrink: 0;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
}
|
}
|
||||||
|
@ -150,6 +152,7 @@ html#ublock0-epicker,
|
||||||
border-top-right-radius: 2px;
|
border-top-right-radius: 2px;
|
||||||
border-bottom-right-radius: 2px;
|
border-bottom-right-radius: 2px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
flex-grow: 1;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
}
|
}
|
||||||
.resultsetModifier input {
|
.resultsetModifier input {
|
||||||
|
|
|
@ -91,12 +91,10 @@ const renderRange = function(id, value, invert = false) {
|
||||||
const slider = $stor(`#${id} > span`);
|
const slider = $stor(`#${id} > span`);
|
||||||
const lside = slider.children[0];
|
const lside = slider.children[0];
|
||||||
const thumb = slider.children[1];
|
const thumb = slider.children[1];
|
||||||
const rside = slider.children[2];
|
const sliderWidth = slider.offsetWidth;
|
||||||
const thumbWidth = thumb.offsetWidth;
|
const maxPercent = (sliderWidth - thumb.offsetWidth) / sliderWidth * 100;
|
||||||
const sliderWidth = slider.offsetWidth - thumbWidth;
|
const widthPercent = value / max * maxPercent;
|
||||||
const x = value * sliderWidth / max;
|
lside.style.width = `${widthPercent}%`;
|
||||||
lside.style.width = `${x}px`;
|
|
||||||
rside.style.width = `${sliderWidth - x}px`;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue