From b92b633cf0c2d528e45c04828a9ce1f5679aeaa3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 6 Jun 2018 04:16:37 +0200 Subject: frame count slider --- app/client/common/slider.component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/client/common') diff --git a/app/client/common/slider.component.js b/app/client/common/slider.component.js index 942640a..fccbc5e 100644 --- a/app/client/common/slider.component.js +++ b/app/client/common/slider.component.js @@ -10,7 +10,7 @@ class Slider extends Component { super(props) this.timeout = 0 this.state = { - value: props.opt[props.name] + value: props.live ? props.opt[props.name] : props.value } this.handleInput = this.handleInput.bind(this) this.handleRange = this.handleRange.bind(this) @@ -33,7 +33,7 @@ class Slider extends Component { } if (old_value !== new_value) { this.setState({ value: new_value }) - this.props.actions.set_param(this.props.name, new_value) + this.props.live && this.props.actions.set_param(this.props.name, new_value) this.props.onChange && this.props.onChange(new_value) } clearTimeout(this.timeout) @@ -49,7 +49,7 @@ class Slider extends Component { } this.setState({ value: new_value }) this.timeout = setTimeout(() => { - this.props.actions.set_param(this.props.name, new_value) + this.props.live && this.props.actions.set_param(this.props.name, new_value) this.props.onChange && this.props.onChange(new_value) }, SLIDER_THROTTLE_TIME) } -- cgit v1.2.3-70-g09d2