diff options
| author | Aubrey-Li <aubreylys@hotmail.com> | 2022-04-26 16:16:28 -0400 |
|---|---|---|
| committer | Aubrey-Li <aubreylys@hotmail.com> | 2022-04-26 16:16:28 -0400 |
| commit | 313c761f4207d55ebda05c18c2bd4a42539fdfe0 (patch) | |
| tree | 94d5716089bb5815fff02cc08d3b08f8ae1e30f8 /src/client/views/DocComponent.tsx | |
| parent | d935a8c1aad3fa6acaa4522aeb667afaaeddc60c (diff) | |
| parent | f4b6942fc1cad1f7e7ec7552e22f6c56bc158a77 (diff) | |
Merge branch master into presentation_upgrade
Diffstat (limited to 'src/client/views/DocComponent.tsx')
| -rw-r--r-- | src/client/views/DocComponent.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 73a261c40..79aaf2158 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -11,6 +11,7 @@ import { DocUtils } from '../documents/Documents'; import { CurrentUserUtils } from '../util/CurrentUserUtils'; import { InteractionUtils } from '../util/InteractionUtils'; import { UndoManager } from '../util/UndoManager'; +import { DocumentView } from './nodes/DocumentView'; import { Touchable } from './Touchable'; @@ -41,6 +42,7 @@ interface ViewBoxBaseProps { Document: Doc; DataDoc?: Doc; ContainingCollectionDoc: Opt<Doc>; + DocumentView?: () => DocumentView; fieldKey: string; layerProvider?: (doc: Doc, assign?: boolean) => boolean; isSelected: (outsideReaction?: boolean) => boolean; @@ -63,7 +65,7 @@ export function ViewBoxBaseComponent<P extends ViewBoxBaseProps>() { // key where data is stored @computed get fieldKey() { return this.props.fieldKey; } - lookupField = (field: string) => ScriptCast(this.layoutDoc.lookupField)?.script.run({ self: this.layoutDoc, data: this.rootDoc, field: field, container: this.props.ContainingCollectionDoc }).result; + lookupField = (field: string) => ScriptCast(this.layoutDoc.lookupField)?.script.run({ self: this.layoutDoc, data: this.rootDoc, field: field, container: this.props.DocumentView?.().props.treeViewDoc ?? this.props.ContainingCollectionDoc }).result; isContentActive = (outsideReaction?: boolean) => ( this.props.isContentActive?.() === false ? false : |
