aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-28 00:39:13 -0400
committerbobzel <zzzman@gmail.com>2020-09-28 00:39:13 -0400
commit0ba42a96a69f79b388c3279d683636f8cf6b0eab (patch)
treed2a0ca53866bd32ded2ade6120f5b6b05885e938 /src/client/views
parent8513eaae38d1cc4e8e9b30f656a4e58d22167351 (diff)
fixed schemacells to accept '=' syntax to set on layout document.
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 1483da99e..2896a8243 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -241,8 +241,9 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
const script = value.substring(value.startsWith("=:=") ? 3 : 2);
retVal = this.props.setComputed(script, value.startsWith(":=") ? this._rowDataDoc : this._rowDoc, this.renderFieldKey, this.props.row, this.props.col);
} else {
- const script = CompileScript(value, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } });
- script.compiled && (retVal = this.applyToDoc(this._rowDataDoc, this.props.row, this.props.col, script.run));
+ const inputscript = value.substring(value.startsWith("=") ? 1 : 0);
+ const script = CompileScript(inputscript, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } });
+ script.compiled && (retVal = this.applyToDoc(inputscript.length !== value.length ? this._rowDoc : this._rowDataDoc, this.props.row, this.props.col, script.run));
}
if (retVal) {
this._isEditing = false; // need to set this here. otherwise, the assignment of the field will invalidate & cause render() to be called with the wrong value for 'editing'