mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-29 05:38:48 +00:00
not use one time binding for slider's callbacks
This commit is contained in:
parent
623bae4794
commit
e7e6732aa3
1 changed files with 12 additions and 3 deletions
|
|
@ -8,9 +8,6 @@ class Slider extends Component {
|
|||
super(props);
|
||||
|
||||
this.orientation = props.orientation;
|
||||
this.onSlide = props.onSlide;
|
||||
this.onComplete = props.onComplete;
|
||||
this.onCancel = props.onCancel;
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
|
|
@ -20,6 +17,18 @@ class Slider extends Component {
|
|||
nextProps.className !== this.props.className;
|
||||
}
|
||||
|
||||
onSlide = (value) => {
|
||||
this.props.onSlide(value);
|
||||
}
|
||||
|
||||
onComplete = (value) => {
|
||||
this.props.onComplete(value);
|
||||
}
|
||||
|
||||
onCancel = () => {
|
||||
this.props.onCancel();
|
||||
}
|
||||
|
||||
calculateSlidingValue = ({ mouseX, mouseY, sliderElement }) => {
|
||||
const { x: sliderX, y: sliderY, width: sliderWidth, height: sliderHeight } = sliderElement.getBoundingClientRect();
|
||||
const sliderStart = this.orientation === 'horizontal' ? sliderX : sliderY;
|
||||
|
|
|
|||
Loading…
Reference in a new issue