Skip to content
Snippets Groups Projects
Commit 94a05bf3 authored by DD's avatar DD
Browse files

Pass the handle update function to the paint editor

parent cc4f6712
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,8 @@ class CostumeTab extends React.Component {
super(props);
bindAll(this, [
'handleSelectCostume',
'handleDeleteCostume'
'handleDeleteCostume',
'handleUpdateSvg'
]);
this.state = {selectedCostumeIndex: 0};
}
......@@ -47,6 +48,10 @@ class CostumeTab extends React.Component {
this.props.vm.deleteCostume(costumeIndex);
}
handleUpdateSvg (svg) {
this.props.vm.updateSvg(this.state.selectedCostumeIndex, svg);
}
render () {
const {
editingTarget,
......@@ -93,7 +98,10 @@ class CostumeTab extends React.Component {
onItemClick={this.handleSelectCostume}
>
{target.costumes ?
<PaintEditor svg={this.props.vm.getCostumeSVG(this.state.selectedCostumeIndex)}/>
<PaintEditor
svg={this.props.vm.getCostumeSvg(this.state.selectedCostumeIndex)}
onUpdateSvg={this.handleUpdateSvg}
/>
: null
}
</AssetPanel>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment