From 94a05bf340b2eea4fdef634a012590f210730929 Mon Sep 17 00:00:00 2001
From: DD <liudi08@gmail.com>
Date: Wed, 30 Aug 2017 18:41:53 -0400
Subject: [PATCH] Pass the handle update function to the paint editor

---
 src/containers/costume-tab.jsx | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/containers/costume-tab.jsx b/src/containers/costume-tab.jsx
index 0d47e6d22..6a24e004b 100644
--- a/src/containers/costume-tab.jsx
+++ b/src/containers/costume-tab.jsx
@@ -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>
-- 
GitLab