From 20a4159484c75396857290779814b948abf49734 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Wed, 29 Apr 2020 23:43:31 -0500 Subject: fixed parts of drag and drop and finalized deleting params --- src/client/views/nodes/ScriptingBox.tsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index f810d178c..8e8340042 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -122,14 +122,17 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent, { x: 0, y: 0 }); } + @action onDrop = (e: Event, de: DragManager.DropEvent, index: any) => { this._dropped = true; + console.log("drop"); const firstParam = this.compileParams[index].split("="); - this.compileParams[index] = firstParam[0] + " = " + de.complete.docDragData?.droppedDocuments[0]; + this.compileParams[index] = firstParam[0] + " = " + de.complete.docDragData?.droppedDocuments[0].id; } - onDelete = (parameter: any) => { - this.compileParams.filter(s => s !== parameter); + @action + onDelete = (num: number) => { + this.compileParams.splice(num, 1); } render() { @@ -154,7 +157,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent; const listParams = this.compileParams.map((parameter, i) => -
+