mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-16 00:00:03 +01:00
fix aspect ratio editing
This commit is contained in:
parent
ab0bda0404
commit
39e8366108
1 changed files with 14 additions and 6 deletions
|
@ -27,11 +27,7 @@ class EditWidgetAspectControl extends React.Component {
|
|||
super(props);
|
||||
|
||||
this.state = {
|
||||
widget: {
|
||||
customProperties:{
|
||||
isLocked: true
|
||||
}
|
||||
}
|
||||
widget: {}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -42,9 +38,21 @@ class EditWidgetAspectControl extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
let parts = this.props.controlId.split('.');
|
||||
let isCustomProperty = true;
|
||||
if (parts.length === 1){
|
||||
isCustomProperty = false;
|
||||
}
|
||||
|
||||
return (
|
||||
<FormGroup>
|
||||
<FormCheck id="lockAspect" checked={this.state.widget.customProperties.isLocked} onChange={e => this.props.handleChange(e)}>Lock Aspect</FormCheck>
|
||||
<FormCheck
|
||||
type='checkbox'
|
||||
id={this.props.controlId}
|
||||
checked={isCustomProperty ? this.state.widget[parts[0]][parts[1]] : this.state.widget[this.props.controlId]}
|
||||
label={"Lock Aspect Ratio"}
|
||||
onChange={e => this.props.handleChange(e)}>
|
||||
</FormCheck>
|
||||
</FormGroup>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue