diff --git a/src/widget/edit-widget/edit-widget-html-content.js b/src/widget/edit-widget/edit-widget-html-content.js index 07f89fb..1df71d5 100644 --- a/src/widget/edit-widget/edit-widget-html-content.js +++ b/src/widget/edit-widget/edit-widget-html-content.js @@ -60,15 +60,15 @@ class EditWidgetHTMLContent extends React.Component { handleKeyIgnore(event){ // This function prevents a keystroke from beeing handled by dialog.js - event.stopPropagation(); - } - + event.stopPropagation(); + } + render() { return ( HTML Content - this.props.handleChange(e)} /> + this.props.handleChange(e)} /> ); diff --git a/src/widget/edit-widget/edit-widget-orientation.js b/src/widget/edit-widget/edit-widget-orientation.js index aee9c14..5ac835f 100644 --- a/src/widget/edit-widget/edit-widget-orientation.js +++ b/src/widget/edit-widget/edit-widget-orientation.js @@ -38,7 +38,15 @@ class EditWidgetOrientation extends Component { } handleOrientationChange(orientation) { - this.props.handleChange({ target: { id: 'orientation', value: orientation } }); + this.props.handleChange({ target: { id: 'customProperties.orientation', value: orientation } }); + this.handleNewDimensions(this.state.widget.width,this.state.widget.height,this.state.widget.minWidth,this.state.widget.minHeight); + } + + handleNewDimensions(width,height,minWidth,minHeight){ + this.props.handleChange({ target: { id: 'height', value: width } }); + this.props.handleChange({ target: { id: 'width', value: height } }); + this.props.handleChange({ target: { id: 'minHeight', value: minWidth } }); + this.props.handleChange({ target: { id: 'minWidth', value: minHeight } }); } render() { diff --git a/src/widget/widgets/slider.js b/src/widget/widgets/slider.js index bd4a6fe..4b9bba5 100644 --- a/src/widget/widgets/slider.js +++ b/src/widget/widgets/slider.js @@ -57,7 +57,7 @@ class WidgetSlider extends Component { if (props.widget.customProperties.default_value && state.value === undefined) { returnState["value"] = props.widget.customProperties.default_value; } - + // Update unit (assuming there is exactly one signal for this widget) let signalID = props.widget.signalIDs[0]; let signal = props.signals.find(sig => sig.id === signalID); @@ -76,6 +76,7 @@ class WidgetSlider extends Component { componentDidUpdate(prevProps: Readonly

, prevState: Readonly, snapshot: SS): void { // Check if the orientation changed, update the size if it did + // this part didn't work -> dimensions and constraints are now handled by the edit orientation component if (this.props.widget.customProperties.orientation !== prevProps.widget.customProperties.orientation) { let baseWidget = this.props.widget; @@ -125,33 +126,14 @@ class WidgetSlider extends Component { }); return ( - !isVertical? (

-
{ fields.control }
+ { fields.control } { fields.value } + {this.props.widget.customProperties.showUnit && fields.unit}
- ) : ( -
- this.valueIsChanging(v) } onAfterChange={ (v) => this.valueChanged(v) }/>, -
- ) ); } } export default WidgetSlider; -/*!isVertical? ( -
- -
{ fields.control }
- { fields.value } -
-) : ( -
- - { fields.control } - { fields.value } - { this.props.widget.customProperties.showUnit && fields.unit } -
-)*/