aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-04-18 17:47:03 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-04-18 17:47:03 -0500
commita261ab5e9697277bec029803f1fa0c890f0c8fd5 (patch)
tree5521e94ce7179c1fa734bddb52a48e671040424f
parent7bef084dc56d499d45cbd94bfedbcd3c49bfe854 (diff)
fix button UI on scripting, changed button onClick
-rw-r--r--src/client/documents/Documents.ts12
-rw-r--r--src/client/views/nodes/ScriptingBox.scss2
-rw-r--r--src/client/views/nodes/ScriptingBox.tsx10
3 files changed, 15 insertions, 9 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index aea4867cd..450f342ca 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -648,12 +648,12 @@ export namespace Docs {
}
export function ButtonDocument(options?: DocumentOptions) {
- const btn = InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" });
- btn.layoutKey = "layout_onClick";
- btn.height = 250;
- btn.width = 200;
- btn.layout_onClick = ScriptingBox.LayoutString("onClick");
- return btn;
+ // const btn = InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" });
+ // btn.layoutKey = "layout_onClick";
+ // btn.height = 250;
+ // btn.width = 200;
+ // btn.layout_onClick = ScriptingBox.LayoutString("onClick");
+ return InstanceFromProto(Prototypes.get(DocumentType.BUTTON), undefined, { ...(options || {}), "onClick-rawScript": "-script-" });
}
export function SliderDocument(options?: DocumentOptions) {
diff --git a/src/client/views/nodes/ScriptingBox.scss b/src/client/views/nodes/ScriptingBox.scss
index 3dfd65bc1..ffef1410d 100644
--- a/src/client/views/nodes/ScriptingBox.scss
+++ b/src/client/views/nodes/ScriptingBox.scss
@@ -34,7 +34,7 @@
height: 30px;
.scriptingBox-button {
- width: 33%;
+ width: 50%;
resize: auto;
}
diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index bd20f9f67..317c48c1a 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -84,7 +84,9 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
/>;
return (
<div className="scriptingBox-outerDiv"
+
onWheel={e => this.props.isSelected(true) && e.stopPropagation()}>
+
<div className="scriptingBox-inputDiv"
onPointerDown={e => this.props.isSelected(true) && e.stopPropagation()} >
<textarea className="scriptingBox-textarea"
@@ -98,12 +100,16 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
</div>
{this.rootDoc.layout === "layout" ? <div></div> : (null)}
<div className="scriptingBox-toolbar">
- <button className="scriptingBox-button" onPointerDown={e => { this.onCompile(); e.stopPropagation(); }}>Compile</button>
- <button className="scriptingBox-button" onPointerDown={e => { this.onRun(); e.stopPropagation(); }}>Run</button>
+ <button className="scriptingBox-button" style={{ width: this.rootDoc.layoutKey === "layout_onClick" ? "33%" : "50%" }}
+ onPointerDown={e => { this.onCompile(); e.stopPropagation(); }}>Compile</button>
+ <button className="scriptingBox-button" style={{ width: this.rootDoc.layoutKey === "layout_onClick" ? "33%" : "50%" }}
+ onPointerDown={e => { this.onRun(); e.stopPropagation(); }}>Run</button>
{this.rootDoc.layoutKey === "layout_onClick" ? <button className="scriptingBox-button"
+ style={{ width: this.rootDoc.layoutKey === "layout_onClick" ? "33%" : "50%" }}
onPointerDown={e => { this.onFinish(); e.stopPropagation(); }}>Finish</button> : null}
</div>
</div>
);
}
+
}