mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 09:42:13 +00:00
disabled slider implemented
This commit is contained in:
parent
7f208dedf6
commit
940801c727
2 changed files with 5 additions and 1 deletions
|
|
@ -81,7 +81,7 @@ class Slider extends Component {
|
|||
const trackBeforeSizeProp = this.orientation === 'horizontal' ? 'width' : 'height';
|
||||
const thumbStart = Math.max(0, Math.min(1, (this.props.value - this.props.minimumValue) / (this.props.maximumValue - this.props.minimumValue)));
|
||||
return (
|
||||
<div ref={this.sliderContainerRef} className={classnames(styles['slider-container'], styles[this.orientation], this.props.className)} onMouseDown={this.onStartSliding}>
|
||||
<div ref={this.sliderContainerRef} className={classnames(styles['slider-container'], styles[this.orientation], { 'disabled': this.props.minimumValue === this.props.maximumValue }, this.props.className)} onMouseDown={this.onStartSliding}>
|
||||
<div className={styles['track']} />
|
||||
<div className={styles['track-before']} style={{ [trackBeforeSizeProp]: `calc(100% * ${thumbStart})` }} />
|
||||
<div className={styles['thumb']} style={{ [thumbStartProp]: `calc(100% * ${thumbStart})` }} />
|
||||
|
|
|
|||
|
|
@ -64,4 +64,8 @@
|
|||
transform: translateY(50%);
|
||||
}
|
||||
}
|
||||
|
||||
&:global(.disabled) {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue