aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocComponent.tsx
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.devices.brown.edu>2022-04-28 17:24:37 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.devices.brown.edu>2022-04-28 17:24:37 -0400
commit22fe2791b6a6e92cc4d0ad953363120b51bd6e2c (patch)
tree0896be213b50026fdf5a05afb64b28328253d757 /src/client/views/DocComponent.tsx
parent42819362e50bc35b3bca228607fcc516d528bb1b (diff)
parent99ae2ccde9dbcf6bae75edea231d4b10c736a692 (diff)
Merge with jenny
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r--src/client/views/DocComponent.tsx4
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 :