From 15316764dfcc1d230efdc6cd2f2f0bd47be3efd8 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Tue, 14 Apr 2020 18:32:27 -0500
Subject: add on finish button and change button drag out

---
 src/client/views/nodes/ScriptingBox.tsx | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

(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 552086790..7fcb9a8d0 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -41,18 +41,11 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
     componentWillUnmount() { this._overlayDisposer?.(); }
 
     @action
-    onSave = () => {
+    onFinish = () => {
         const result = CompileScript(this.rawScript, {});
-        this._errorMessage = "";
-        if (result.compiled) {
-            this._errorMessage = "";
-            this.props.Document.data = new ScriptField(result);
-
-            //button
-        }
-        else {
-            //
-        }
+        this.rootDoc.layoutKey = "layout";
+        this.rootDoc.height = 50;
+        this.rootDoc.width = 100;
         this.props.Document.documentText = this.rawScript;
     }
 
@@ -106,6 +99,8 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
                 <div className="scriptingBox-toolbar">
                     <button className="scriptingBox-button" onPointerDown={e => { this.onCompile(); e.stopPropagation(); }}>Compile</button>
                     <button className="scriptingBox-button" onPointerDown={e => { this.onRun(); e.stopPropagation(); }}>Run</button>
+                    {this.rootDoc.layoutKey === "layout_onClick" ? <button className="scriptingBox-button"
+                        onPointerDown={e => { this.onFinish(); e.stopPropagation(); }}>Finish</button> : null}
                 </div>
             </div>
         );
-- 
cgit v1.2.3-70-g09d2

