1
0
Fork 0
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:
Sonja Happ 2020-03-18 13:13:43 +01:00
parent ab0bda0404
commit 39e8366108

View file

@ -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>
);
}