From bdec227a1a7498e74388434fa5a7deda9974bd8c Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Mon, 8 Jun 2020 21:37:01 -0400
Subject: fixed dependency cycle for scriptManager

---
 src/client/views/nodes/ScriptingBox.tsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 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 2e7b544d2..07c156742 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -22,7 +22,6 @@ const _global = (window /* browser */ || global /* node */) as any;
 
 import ReactTextareaAutocomplete from "@webscopeio/react-textarea-autocomplete";
 import "@webscopeio/react-textarea-autocomplete/style.css";
-import { ScriptManager } from "../../util/ScriptManager";
 
 
 const ScriptingSchema = createSchema({});
@@ -231,6 +230,9 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
         }
     }
 
+    public static DeleteScript: undefined | ((doc: Doc) => void);
+    public static AddScript: undefined | ((doc: Doc) => void);
+
     @action
     onCreate = () => {
 
@@ -247,12 +249,12 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
         this.dataDoc.funcName = this._functionName;
         this.dataDoc.descripition = this._functionDescription;
 
-        ScriptManager.Instance.deleteScript(this.dataDoc);
+        ScriptingBox.DeleteScript?.(this.dataDoc);
 
         this.dataDoc.funcName = "testingTitle";
         this.dataDoc.descripition = "description test";
 
-        ScriptManager.Instance.addScript(this.dataDoc);
+        ScriptingBox.AddScript?.(this.dataDoc);
 
         console.log("created");
     }
-- 
cgit v1.2.3-70-g09d2

