diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-14 17:36:27 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-04-14 17:36:27 -0500 |
commit | c17e8ebf0454ad2067ab6556355c5bb69b7cf41e (patch) | |
tree | 7bc1dcadea7630425ba01dc530f3ee740af89726 | |
parent | df170f53e2c88bd77a552e42b2eba5470b15cb03 (diff) |
added onSave
-rw-r--r-- | src/client/views/nodes/ScriptingBox.tsx | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ -39,6 +39,22 @@ export class ScriptingBox extends DocAnnotatableComponent<FieldViewProps, Script } @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); const result = CompileScript(this.rawScript, { |