App style is now single source of truth

This commit is contained in:
lukasmartinelli
2016-09-10 13:42:23 +02:00
parent c84318e6fe
commit e0a8b0a8e9
5 changed files with 117 additions and 122 deletions

View File

@@ -12,9 +12,8 @@ export class WorkspaceDrawer extends React.Component {
workContext: React.PropTypes.oneOf(['layers', 'settings']).isRequired,
}
onLayersChanged(layers) {
const changedStyle = this.props.mapStyle
changedStyle.layers = layers
onLayersChanged(changedLayers) {
const changedStyle = this.props.mapStyle.set('layers', changedLayers)
this.props.onStyleChanged(changedStyle)
}
@@ -24,7 +23,7 @@ export class WorkspaceDrawer extends React.Component {
if(this.props.workContext === "layers") {
workspaceContent = <LayerEditor
onLayersChanged={this.onLayersChanged.bind(this)}
layers={this.props.mapStyle.layers}
layers={this.props.mapStyle.get('layers')}
/>
}