Commit 5e4c26f6 authored by Sonja Happ's avatar Sonja Happ

Merge remote-tracking branch 'origin/develop' into develop

parents 15e3f041 834efecb
......@@ -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 (
<FormGroup controlId={this.props.controlId}>
<FormLabel>HTML Content</FormLabel>
<FormControl type="text" onKeyPress={this.handleKeyIgnore} componentclass="textarea" style={{ height: 200 }} placeholder={this.props.placeholder} value={this.state.value} onChange={e => this.props.handleChange(e)} />
<FormControl onKeyDown={this.handleKeyIgnore} componentclass="textarea" style={{ height: 200 }} placeholder={this.props.placeholder} value={this.state.value} onChange={e => this.props.handleChange(e)} />
<FormControl.Feedback />
</FormGroup>
);
......
......@@ -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() {
......
......@@ -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<P>, prevState: Readonly<S>, 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? (
<div className={widgetClasses}>
<label>{ fields.name }</label>
<div className='slider'>{ fields.control }</div>
{ fields.control }
<span>{ fields.value }</span>
{this.props.widget.customProperties.showUnit && fields.unit}
</div>
) : (
<div className={widgetClasses}>
<Slider vertical min={ this.props.widget.customProperties.rangeMin } max={ this.props.widget.customProperties.rangeMax } step={ this.props.widget.customProperties.step } value={ this.state.value } disabled={ this.props.editing } onChange={ (v) => this.valueIsChanging(v) } onAfterChange={ (v) => this.valueChanged(v) }/>,
</div>
)
);
}
}
export default WidgetSlider;
/*!isVertical? (
<div className={widgetClasses}>
<label>{ fields.name }</label>
<div className='slider'>{ fields.control }</div>
<span>{ fields.value }</span>
</div>
) : (
<div className={widgetClasses}>
<label>{ fields.name }</label>
{ fields.control }
{ fields.value }
{ this.props.widget.customProperties.showUnit && fields.unit }
</div>
)*/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment