From 4aef738968b0d54caf3fb8cb511ae803463c10f6 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Wed, 10 Jun 2020 17:35:58 -0400
Subject: fixed iniitalization of ScriptManager

---
 src/client/views/nodes/ScriptingBox.tsx | 18 +++++++-----------
 1 file changed, 7 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 cf941fb7a..dc6fc142d 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -1,4 +1,6 @@
-import { action, computed, observable, trace, runInAction } from "mobx";
+import ReactTextareaAutocomplete from "@webscopeio/react-textarea-autocomplete";
+import "@webscopeio/react-textarea-autocomplete/style.css";
+import { action, computed, observable, runInAction, trace } from "mobx";
 import { observer } from "mobx-react";
 import * as React from "react";
 import { Doc } from "../../../fields/Doc";
@@ -10,7 +12,8 @@ import { Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types";
 import { returnEmptyString } from "../../../Utils";
 import { DragManager } from "../../util/DragManager";
 import { InteractionUtils } from "../../util/InteractionUtils";
-import { CompileScript, ScriptParam, Scripting } from "../../util/Scripting";
+import { CompileScript, Scripting, ScriptParam } from "../../util/Scripting";
+import { ScriptManager } from "../../util/ScriptManager";
 import { ContextMenu } from "../ContextMenu";
 import { ViewBoxAnnotatableComponent } from "../DocComponent";
 import { EditableView } from "../EditableView";
@@ -20,10 +23,6 @@ import { DocumentIconContainer } from "./DocumentIcon";
 import "./ScriptingBox.scss";
 const _global = (window /* browser */ || global /* node */) as any;
 
-import ReactTextareaAutocomplete from "@webscopeio/react-textarea-autocomplete";
-import "@webscopeio/react-textarea-autocomplete/style.css";
-
-
 const ScriptingSchema = createSchema({});
 type ScriptingDocument = makeInterface<[typeof ScriptingSchema, typeof documentSchema]>;
 const ScriptingDocument = makeInterface(ScriptingSchema, documentSchema);
@@ -233,9 +232,6 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
         }
     }
 
-    public static DeleteScript: undefined | ((doc: Doc) => void);
-    public static AddScript: undefined | ((doc: Doc) => void);
-
     @action
     onCreate = () => {
 
@@ -254,8 +250,8 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
         this.dataDoc.funcName = this.functionName;
         this.dataDoc.descripition = this.functionDescription;
 
-        ScriptingBox.DeleteScript?.(this.dataDoc);
-        ScriptingBox.AddScript?.(this.dataDoc);
+        ScriptManager.Instance.deleteScript(this.dataDoc);
+        ScriptManager.Instance.addScript(this.dataDoc);
 
         console.log("created");
     }
-- 
cgit v1.2.3-70-g09d2

