diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-05-17 13:58:55 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-05-17 13:58:55 -0400 |
commit | 03383387464fe83b57e5a998ee34c0601624a912 (patch) | |
tree | d240430de9b7a7dc6cfdc0ca9b419846ef9e6b87 /src/client/views/nodes/ScriptingBox.tsx | |
parent | 0b12ca7a6a999cf3a0b130567b4f1354e3ea785b (diff) |
fixed compiling
Diffstat (limited to 'src/client/views/nodes/ScriptingBox.tsx')
-rw-r--r-- | src/client/views/nodes/ScriptingBox.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index b507d250b..62af1176f 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -15,6 +15,7 @@ import { OverlayView } from "../OverlayView"; import { DocumentIconContainer, DocumentIcon } from "./DocumentIcon"; import { List } from "../../../fields/List"; import { DragManager } from "../../util/DragManager"; +import { Doc } from "../../../fields/Doc"; const ScriptingSchema = createSchema({}); type ScriptingDocument = makeInterface<[typeof ScriptingSchema, typeof documentSchema]>; @@ -77,7 +78,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc const params = this.compileParams.reduce((o: ScriptParam, p: string) => { const param = p.split("="); - o[param[0]] = param[1]; + o[param[0].trim()] = param[1].trim(); return o; }, {} as ScriptParam); @@ -145,7 +146,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc const droppedDocs = de.complete.docDragData?.droppedDocuments; if (droppedDocs?.length) { const dropped = droppedDocs[0]; - this.compileParams[index] = firstParam[0] + " = " + dropped; + this.compileParams[index] = firstParam[0] + " = " + Doc.name; // you can't just bind a variable to a specific Doc. The Doc would have to be added to 'capturedVariables' field of the compile options, but I think it makes more sense to just be declaring this variable to be a Doc } } |