diff options
author | bob <bcz@cs.brown.edu> | 2019-12-12 15:26:08 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-12-12 15:26:08 -0500 |
commit | c21958664a8050fbe9d420c41330c1adcc402ae6 (patch) | |
tree | 5fdaaf6e628e7676622800d9d9e048dca0b42a3a /src/client/views/ScriptBox.tsx | |
parent | 5a8bc9ba24154437dc82d6746f91c6d36d29834a (diff) |
fixed script box draggign w/ parameters
Diffstat (limited to 'src/client/views/ScriptBox.tsx')
-rw-r--r-- | src/client/views/ScriptBox.tsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/ScriptBox.tsx b/src/client/views/ScriptBox.tsx index 65d96f364..956e83238 100644 --- a/src/client/views/ScriptBox.tsx +++ b/src/client/views/ScriptBox.tsx @@ -113,7 +113,15 @@ export class ScriptBox extends React.Component<ScriptBoxProps> { return; } - params.length && DragManager.StartButtonDrag([], text, "a script", {}, params, (button: Doc) => { }, clientX, clientY); + var div = document.createElement("div"); + div.style.width = "90"; + div.style.height = "20"; + div.style.background = "gray"; + div.style.position = "absolute"; + div.style.display = "inline-block"; + div.style.transform = `translate(${clientX}px, ${clientY}px)`; + div.innerHTML = "button"; + params.length && DragManager.StartButtonDrag([div], text, doc.title + "-instance", {}, params, (button: Doc) => { }, clientX, clientY); doc[fieldKey] = new ScriptField(script); overlayDisposer(); |