Reactivate on change for background layer

This commit is contained in:
lukasmartinelli
2016-09-12 20:10:49 +02:00
parent 885e31111c
commit 7c7c8b7111
7 changed files with 47 additions and 7 deletions
+12 -4
View File
@@ -15,8 +15,7 @@ export default class BackgroundLayer extends React.Component {
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
}
onPaintChanged(property, e) {
let value = e.target.value
onPaintChanged(property, value) {
if (property == "background-opacity" && !isNaN(parseFloat(value))) {
value = parseFloat(value)
}
@@ -25,8 +24,17 @@ export default class BackgroundLayer extends React.Component {
render() {
return <div>
<PropertyGroup layerType="background" groupType="layout" properties={this.props.layer.get('layout', Immutable.Map())}/>
<PropertyGroup layerType="background" groupType="paint" properties={this.props.layer.get('paint', Immutable.Map())}/>
<PropertyGroup
layerType="background"
groupType="layout"
properties={this.props.layer.get('layout', Immutable.Map())}
/>
<PropertyGroup
onChange={this.props.onPaintChanged.bind(this)}
layerType="background"
groupType="paint"
properties={this.props.layer.get('paint', Immutable.Map())}
/>
</div>
}
}
+11 -2
View File
@@ -26,8 +26,17 @@ export default class FillLayer extends React.Component {
render() {
return <div>
<PropertyGroup layerType="fill" groupType="layout" properties={this.props.layer.get('layout', Immutable.Map())}/>
<PropertyGroup layerType="fill" groupType="paint" properties={this.props.layer.get('paint', Immutable.Map())}/>
<PropertyGroup
layerType="fill"
groupType="layout"
properties={this.props.layer.get('layout', Immutable.Map())}
/>
<PropertyGroup
onChange={this.props.onPaintChanged.bind(this)}
layerType="fill"
groupType="paint"
properties={this.props.layer.get('paint', Immutable.Map())}
/>
</div>
}
}