From c17e8ebf0454ad2067ab6556355c5bb69b7cf41e Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Tue, 14 Apr 2020 17:36:27 -0500
Subject: added  onSave

---
 src/client/views/nodes/ScriptingBox.tsx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'src/client/views/nodes/ScriptingBox.tsx')

diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index 93956592f..4159bbed4 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -38,6 +38,22 @@ export class ScriptingBox extends DocAnnotatableComponent<FieldViewProps, Script
         this.rawScript = ScriptCast(this.dataDoc[this.props.fieldKey])?.script?.originalScript || this.rawScript;
     }
 
+    @action
+    onSave = () => {
+        const result = CompileScript(this.rawScript, {});
+        this._errorMessage = "";
+        if (result.compiled) {
+            this._errorMessage = "";
+            this.props.Document.data = new ScriptField(result);
+
+            //button
+        }
+        else {
+            //
+        }
+        this.props.Document.documentText = this.rawScript;
+    }
+
     @action
     onCompile = () => {
         const params = this.compileParams.reduce((o: ScriptParam, p: string) => { o[p] = "any"; return o; }, {} as ScriptParam);
-- 
cgit v1.2.3-70-g09d2

