diff options
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 4968dd7fc..63e3e0431 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -290,7 +290,8 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu } else if (this.onClickHandler?.script) { SelectionManager.DeselectAll(); UndoManager.RunInBatch(() => this.onClickHandler!.script.run({ - this: this.Document.isTemplateForField && this.props.DataDoc ? this.props.DataDoc : this.props.Document, // try this.props.Document.expandedTemplate || this.props.Document + this: this.props.Document, + self: Cast(this.props.Document.expandedTemplate, Doc, null) || this.props.Document, containingCollection: this.props.ContainingCollectionDoc, shiftKey: e.shiftKey }, console.log) && !this.props.Document.dontSelect && !this.props.Document.isButton && this.select(false), "on click"); } else if (this.Document.type === DocumentType.BUTTON) { |