diff options
Diffstat (limited to 'src/fields')
-rw-r--r-- | src/fields/Doc.ts | 2 | ||||
-rw-r--r-- | src/fields/ScriptField.ts | 6 | ||||
-rw-r--r-- | src/fields/documentSchemas.ts | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index a1e1e11b1..9f38f4369 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -574,7 +574,7 @@ export namespace Doc { if (field instanceof RefField) { copy[key] = field; } else if (cfield instanceof ComputedField) { - copy[key] = ComputedField.MakeFunction(cfield.script.originalScript); + copy[key] = cfield[Copy]();// ComputedField.MakeFunction(cfield.script.originalScript); } else if (field instanceof ObjectField) { copy[key] = doc[key] instanceof Doc ? key.includes("layout[") ? Doc.MakeCopy(doc[key] as Doc, false) : doc[key] : // reference documents except copy documents that are expanded teplate fields diff --git a/src/fields/ScriptField.ts b/src/fields/ScriptField.ts index 0ac1ac360..566390c0d 100644 --- a/src/fields/ScriptField.ts +++ b/src/fields/ScriptField.ts @@ -140,10 +140,8 @@ export class ComputedField extends ScriptField { _valueOutsideReaction = (doc: Doc) => this._lastComputedResult = this.script.run({ this: doc, self: Cast(doc.rootDocument, Doc, null) || doc, _last_: this._lastComputedResult }, console.log).result; - constructor(script: CompiledScript, setterscript?: CompiledScript) { - super(script, - !setterscript && script?.originalScript.includes("self.timecode") ? - ScriptField.CompileScript("self['x' + self.timecode] = value", { value: "any" }, true) : setterscript); + [Copy](): ObjectField { + return new ComputedField(this.script); } public static MakeScript(script: string, params: object = {}) { diff --git a/src/fields/documentSchemas.ts b/src/fields/documentSchemas.ts index cacba43b6..142f7e079 100644 --- a/src/fields/documentSchemas.ts +++ b/src/fields/documentSchemas.ts @@ -20,7 +20,9 @@ export const documentSchema = createSchema({ z: "number", // z "coordinate" - non-zero specifies the overlay layer of a freeformview zIndex: "number", // zIndex of a document in a freeform view scrollY: "number", // "command" to scroll a document to a position on load (the value will be reset to 0 after that ) + scrollX: "number", // "command" to scroll a document to a position on load (the value will be reset to 0 after that ) scrollTop: "number", // scroll position of a scrollable document (pdf, text, web) + scrollLeft: "number", // scroll position of a scrollable document (pdf, text, web) // appearance properties on the layout _autoHeight: "boolean", // whether the height of the document should be computed automatically based on its contents @@ -74,8 +76,8 @@ export const documentSchema = createSchema({ isLinkButton: "boolean", // whether document functions as a link follow button to follow the first link on the document when clicked isBackground: "boolean", // whether document is a background element and ignores input events (can only select with marquee) lockedPosition: "boolean", // whether the document can be moved (dragged) - lockedTransform: "boolean", // whether the document can be panned/zoomed - + _lockedTransform: "boolean",// whether a freeformview can pan/zoom + // drag drop properties dragFactory: Doc, // the document that serves as the "template" for the onDragStart script. ie, to drag out copies of the dragFactory document. dropAction: "string", // override specifying what should happen when this document is dropped (can be "alias", "copy", "move") |