Propagate filter changes

This commit is contained in:
Lukas Martinelli 2016-12-19 14:56:10 +01:00
parent a981a39691
commit 3c3f396937

View file

@ -82,6 +82,12 @@ export class LayerEditor extends React.Component {
this.props.onLayerChanged(changedLayer)
}
onFilterChanged(newValue) {
let layer = this.props.layer
const changedLayer = layer.set('filter', newValue)
this.props.onLayerChanged(changedLayer)
}
layerFromType(type) {
if (type === "fill") {
return <FillLayer
@ -149,7 +155,7 @@ export class LayerEditor extends React.Component {
</Toolbar>
<FilterEditor
filter={this.props.layer.get('filter', Immutable.List()).toJSON()}
onChange={f => console.log('filter changed', f)}
onChange={f => this.onFilterChanged(Immutable.fromJS(f))}
/>
{this.props.layer.get('type') !== 'background' && <SourceEditor
source={this.props.layer.get('source')}