summaryrefslogtreecommitdiff
path: root/app/client/common
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-06 16:13:52 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-06 16:13:52 +0200
commit1ba1d455167bfd507d3cf14d43fbd430caeb7fe7 (patch)
treed3665883c8f505b51eef24b7e3268d42b52cbd03 /app/client/common
parentfc1c3835501b97e5d15ac33bd812cd87b20aabad (diff)
update spectrogram delta
Diffstat (limited to 'app/client/common')
-rw-r--r--app/client/common/slider.component.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/client/common/slider.component.js b/app/client/common/slider.component.js
index fccbc5e..cc00650 100644
--- a/app/client/common/slider.component.js
+++ b/app/client/common/slider.component.js
@@ -25,10 +25,15 @@ class Slider extends Component {
let { name, opt } = this.props
let old_value = opt[name]
let new_value = e.target.value
- if (this.props.type === 'int') {
+ console.log(this.props)
+ console.log(new_value, this.props.defaultValue)
+ if (new_value === '') {
+ new_value = this.props.defaultValue || (this.props.max - this.props.min) / 2
+ }
+ else if (this.props.type === 'int') {
new_value = parseInt(new_value)
}
- if (this.props.type === 'odd') {
+ else if (this.props.type === 'odd') {
new_value = parseInt(Math.floor(new_value / 2) * 2 + 1)
}
if (old_value !== new_value) {