mirror of
https://github.com/maputnik/editor.git
synced 2025-12-27 16:40:00 +00:00
Show editor for selected layer
This commit is contained in:
@@ -43,9 +43,6 @@ export class LayerEditor extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
|
||||
this.state = {
|
||||
isOpened: false,
|
||||
}
|
||||
}
|
||||
|
||||
getChildContext () {
|
||||
@@ -79,10 +76,6 @@ export class LayerEditor extends React.Component {
|
||||
this.props.onLayerChanged(changedLayer)
|
||||
}
|
||||
|
||||
toggleLayer() {
|
||||
this.setState({isOpened: !this.state.isOpened})
|
||||
}
|
||||
|
||||
layerFromType(type) {
|
||||
if (type === "fill") {
|
||||
return <FillLayer
|
||||
@@ -143,7 +136,7 @@ export class LayerEditor extends React.Component {
|
||||
borderColor: theme.borderColor,
|
||||
borderLeftColor: this.props.layer.getIn(['metadata', 'maputnik:color'])
|
||||
}}>
|
||||
<Toolbar onClick={this.toggleLayer.bind(this)}>
|
||||
<Toolbar>
|
||||
<NavItem style={{fontWeight: 400}}>
|
||||
#{this.props.layer.get('id')}
|
||||
</NavItem>
|
||||
@@ -155,11 +148,9 @@ export class LayerEditor extends React.Component {
|
||||
<MdDelete />
|
||||
</NavItem>
|
||||
</Toolbar>
|
||||
<Collapse isOpened={this.state.isOpened}>
|
||||
<div style={{padding: theme.scale[2], paddingRight: 0, backgroundColor: theme.colors.black}}>
|
||||
{this.layerFromType(this.props.layer.get('type'))}
|
||||
</div>
|
||||
</Collapse>
|
||||
<div style={{padding: theme.scale[2], paddingRight: 0, backgroundColor: theme.colors.black}}>
|
||||
{this.layerFromType(this.props.layer.get('type'))}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user