From 70898430dc45ec3422ab2e05fc46054ba56a1909 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 24 Mar 2025 20:13:43 -0400 Subject: fixed iconifying collections to show image icon. fixed shortcut for using cached template. fixed onClick prop type --- src/client/views/DocComponent.tsx | 4 +++- src/client/views/collections/CollectionSubView.tsx | 4 ++-- src/client/views/nodes/DocumentContentsView.tsx | 2 +- src/client/views/nodes/FieldView.tsx | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/client') diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 8f254ddcd..3a868d1f9 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -192,7 +192,9 @@ export function ViewBoxAnnotatableComponent

() { * This is the unique data repository for a dcoument that stores the intrinsic document data */ @computed get dataDoc() { - return this._renderDoc.isTemplateForField || this._renderDoc.isTemplateDoc ? (this._props.TemplateDataDocument ?? this._renderDoc[DocData]) : this._props.Document[DocData]; + return this._renderDoc.isTemplateForField || this._renderDoc.isTemplateDoc ? + (this._props.TemplateDataDocument ?? this._renderDoc[DocData]) : + this._props.Document[DocData]; // prettier-ignore } /** diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx index a43cf0755..7d487fed8 100644 --- a/src/client/views/collections/CollectionSubView.tsx +++ b/src/client/views/collections/CollectionSubView.tsx @@ -109,8 +109,8 @@ export function CollectionSubView() { get dataDoc() { return this._props.TemplateDataDocument instanceof Doc && this.layoutDoc.isTemplateForField // - ? this._props.TemplateDataDocument[DocData] - : this.layoutDoc.resolvedDataDoc + ? Doc.GetProto(this._props.TemplateDataDocument) + : this.Document.resolvedDataDoc ? this._props.Document : this.Document[DocData]; // if the layout document has a resolvedDataDoc, then we don't want to get its parent which would be the unexpanded template } diff --git a/src/client/views/nodes/DocumentContentsView.tsx b/src/client/views/nodes/DocumentContentsView.tsx index 47c5734f7..d1eae1784 100644 --- a/src/client/views/nodes/DocumentContentsView.tsx +++ b/src/client/views/nodes/DocumentContentsView.tsx @@ -113,7 +113,7 @@ export class DocumentContentsView extends ObservableReactComponent; setTitleFocus?: () => void; focus: FocusFuncType; - onClickScript?: () => ScriptField; + onClickScript?: () => ScriptField | undefined; onDoubleClickScript?: () => ScriptField; onPointerDownScript?: () => ScriptField; onPointerUpScript?: () => ScriptField; -- cgit v1.2.3-70-g09d2