mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
time shows in plot edit dialog, closes #247
This commit is contained in:
parent
765a0a61af
commit
63ac373191
1 changed files with 15 additions and 2 deletions
|
@ -23,7 +23,7 @@ class EditWidgetTimeControl extends Component {
|
|||
super(props);
|
||||
|
||||
this.state = {
|
||||
widget: {
|
||||
widget: {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -36,10 +36,23 @@ class EditWidgetTimeControl extends Component {
|
|||
|
||||
render() {
|
||||
|
||||
let parts = this.props.controlId.split('.');
|
||||
let isCustomProperty = true;
|
||||
if (parts.length === 1){
|
||||
isCustomProperty = false;
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup controlId= {this.props.controlId}>
|
||||
<FormLabel>Time</FormLabel>
|
||||
<FormControl type="number" min="1" max="300" placeholder="Enter time" value={this.state.widget[this.props.controlId]} onChange={(e) => this.props.handleChange(e)} />
|
||||
<FormControl
|
||||
type="number"
|
||||
min="1"
|
||||
max="300"
|
||||
placeholder="Enter time"
|
||||
value={isCustomProperty ? this.state.widget[parts[0]][parts[1]] : this.state.widget[this.props.controlId]}
|
||||
onChange={(e) => this.props.handleChange(e)}
|
||||
/>
|
||||
<FormText>Time in seconds</FormText>
|
||||
</FormGroup>
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue