summaryrefslogtreecommitdiff
path: root/app/client/common
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 14:40:44 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 14:40:44 +0200
commit39ee780fce2c75bcfed078df9cbbfbc04853da1d (patch)
tree7240492dfc8cd170ff00f63eb9a3406d33680016 /app/client/common
parenta952ae8a1633b7650d5d3c51ba51b3e16a8639ad (diff)
view mode toggle
Diffstat (limited to 'app/client/common')
-rw-r--r--app/client/common/paramGroup.component.js20
-rw-r--r--app/client/common/slider.component.js2
2 files changed, 12 insertions, 10 deletions
diff --git a/app/client/common/paramGroup.component.js b/app/client/common/paramGroup.component.js
index 2533642..6dd45f6 100644
--- a/app/client/common/paramGroup.component.js
+++ b/app/client/common/paramGroup.component.js
@@ -14,20 +14,22 @@ class ParamGroup extends Component {
this.props.actions.set_param(this.props.name, new_value)
}
render() {
- const props = this.props
const checked = this.props.opt[this.props.name]
- const className = checked ? 'paramGroup active' : 'paramGroup inactive'
+ const toggle = !this.props.noToggle
+ const className = (!toggle || checked) ? 'paramGroup active' : 'paramGroup inactive'
return (
<div className={className}>
<label>
- <h3>{props.title}</h3>
- <input
- type='checkbox'
- onClick={this.handleClick}
- checked={checked}
- />
+ <h3>{this.props.title}</h3>
+ {toggle ?
+ <input
+ type='checkbox'
+ onClick={this.handleClick}
+ checked={checked}
+ />
+ : null}
</label>
- {props.children}
+ {this.props.children}
</div>
)
}
diff --git a/app/client/common/slider.component.js b/app/client/common/slider.component.js
index 1fedbfb..e3e3f48 100644
--- a/app/client/common/slider.component.js
+++ b/app/client/common/slider.component.js
@@ -66,7 +66,7 @@ class Slider extends Component {
text_value = parseFloat(value).toFixed(2)
}
return (
- <div class='slider'>
+ <div class='slider param'>
<label>
<span>{title || name.replace(/_/g, ' ')}</span>
<input type='text' value={text_value} onBlur={this.handleInput} />