Commit f3d0576d authored by Laura Fuentes Grau's avatar Laura Fuentes Grau

HTML content: pressing enter doesn't reload page anymore, Orientation: type can now be changed

parent 9f6ee377
...@@ -60,15 +60,15 @@ class EditWidgetHTMLContent extends React.Component { ...@@ -60,15 +60,15 @@ class EditWidgetHTMLContent extends React.Component {
handleKeyIgnore(event){ handleKeyIgnore(event){
// This function prevents a keystroke from beeing handled by dialog.js // This function prevents a keystroke from beeing handled by dialog.js
event.stopPropagation(); event.stopPropagation();
} }
render() { render() {
return ( return (
<FormGroup controlId={this.props.controlId}> <FormGroup controlId={this.props.controlId}>
<FormLabel>HTML Content</FormLabel> <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 /> <FormControl.Feedback />
</FormGroup> </FormGroup>
); );
......
...@@ -38,7 +38,9 @@ class EditWidgetOrientation extends Component { ...@@ -38,7 +38,9 @@ class EditWidgetOrientation extends Component {
} }
handleOrientationChange(orientation) { handleOrientationChange(orientation) {
this.props.handleChange({ target: { id: 'orientation', value: orientation } }); console.log("handle OrinetationChange was called. the orientation: " + orientation);
this.props.handleChange({ target: { id: 'customProperties.orientation', value: orientation } });
} }
render() { render() {
...@@ -55,6 +57,7 @@ class EditWidgetOrientation extends Component { ...@@ -55,6 +57,7 @@ class EditWidgetOrientation extends Component {
Object.keys(WidgetSlider.OrientationTypes).map( (type) => { Object.keys(WidgetSlider.OrientationTypes).map( (type) => {
let value = WidgetSlider.OrientationTypes[type].value; let value = WidgetSlider.OrientationTypes[type].value;
let name = WidgetSlider.OrientationTypes[type].name; let name = WidgetSlider.OrientationTypes[type].name;
console.log("value: " + value + " name: " + name)
return ( return (
<FormCheck inline label={name} key={value} id={value} type='radio' title='orientation' checked={ value === this.state.widget.customProperties.orientation } onChange={(e) => this.handleOrientationChange(value)}> <FormCheck inline label={name} key={value} id={value} type='radio' title='orientation' checked={ value === this.state.widget.customProperties.orientation } onChange={(e) => this.handleOrientationChange(value)}>
......
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