aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/CurrentUserUtils.ts2
-rw-r--r--src/client/views/nodes/ScriptingBox.scss1
-rw-r--r--src/client/views/nodes/ScriptingBox.tsx43
3 files changed, 31 insertions, 15 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 632187b49..4c30b4c03 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -738,5 +738,5 @@ export class CurrentUserUtils {
Scripting.addGlobal("setupMobileInkingDoc", function setupMobileInkingDoc(userDoc: Doc) { return CurrentUserUtils.setupMobileInkingDoc(userDoc); });
Scripting.addGlobal(function setupMobileUploadDoc(userDoc: Doc) { return CurrentUserUtils.setupMobileUploadDoc(userDoc); },
- "initializes the Mobile upload document", "{ userDoc: the document to initialize }");
+ "initializes the Mobile upload document", "{ userDoc: Doc }");
Scripting.addGlobal(function createNewWorkspace() { return MainView.Instance.createNewWorkspace(); }); \ No newline at end of file
diff --git a/src/client/views/nodes/ScriptingBox.scss b/src/client/views/nodes/ScriptingBox.scss
index edf79b38e..ae2569704 100644
--- a/src/client/views/nodes/ScriptingBox.scss
+++ b/src/client/views/nodes/ScriptingBox.scss
@@ -94,6 +94,7 @@
width: 100%;
text-align: left;
outline: none;
+ overflow-y: scroll;
}
.rta__entity:hover {
diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index f1105e614..f6e7e375b 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -491,10 +491,25 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
this._scriptSuggestedParams = this.getSuggestedParams(pos);
if (this._scriptSuggestedParams !== undefined && this._scriptSuggestedParams.length > 0) {
- this._paramSuggestion = true;
+ if (this.rawScript[pos - 2] !== "(") {
+ console.log("suggestion params");
+ this._paramSuggestion = true;
+ }
}
} else if (e.key === ")") {
this._paramSuggestion = false;
+ } else {
+ console.log(this.rawScript.split("(").length - 1);
+ console.log(this.rawScript.split(")").length - 1);
+ if (this.rawScript.split("(").length - 1 <= this.rawScript.split(")").length - 1) {
+ console.log("removed params");
+ this._paramSuggestion = false;
+ } else {
+ if (e.key === "Backspace") {
+ console.log("removed params");
+ this._paramSuggestion = false;
+ }
+ }
}
}
@@ -542,12 +557,12 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
onMouseLeave={() => this.setHovered(false)}>
{value}
</div>
- {!this._hovered ? (null) :
- <>
- <div key="desc" style={{ fontSize: "10px" }}>{this.getDescription(value)}</div>
- <div key="params" style={{ fontSize: "10px" }}>{this.getParams(value)}</div>
- </>
- }
+ {/* {!this._hovered ? (null) :
+ <> */}
+ <div key="desc" style={{ fontSize: "10px" }}>{this.getDescription(value)}</div>
+ <div key="params" style={{ fontSize: "10px" }}>{this.getParams(value)}</div>
+ {/* </>
+ } */}
</div>,
output: (item: any, trigger) => {
this._spaced = true;
@@ -563,12 +578,12 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
onMouseLeave={() => this.setHovered(false)}>
{value}
</div>
- {!this._hovered ? (null) :
- <>
- <div key="desc" style={{ fontSize: "10px" }}>{this.getDescription(value)}</div>
- <div key="params" style={{ fontSize: "10px" }}>{this.getParams(value)}</div>
- </>
- }
+ {/* {!this._hovered ? (null) :
+ <> */}
+ <div key="desc" style={{ fontSize: "10px" }}>{this.getDescription(value)}</div>
+ <div key="params" style={{ fontSize: "10px" }}>{this.getParams(value)}</div>
+ {/* </>
+ } */}
</div>,
output: (item: any, trigger) => {
this._spaced = true;
@@ -577,7 +592,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
}
}}
- onKeyPress={(e) => this.keyHandler(e, this.caretPos)}
+ onKeyDown={(e) => this.keyHandler(e, this.caretPos)}
onCaretPositionChange={(number: any) => this.handlePosChange(number)}
/>