diff options
author | Michael Foiani <sotech117@michaels-mbp-3.devices.brown.edu> | 2022-04-28 17:31:27 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@michaels-mbp-3.devices.brown.edu> | 2022-04-28 17:31:27 -0400 |
commit | 813ac366831c95f3fa11e01b9588cf18cbe466bc (patch) | |
tree | 24a98e427543ff57c9396918ff12ae1cf81a5a92 /src/client/views/DocComponent.tsx | |
parent | f8503355ff82930e640369637c33d989fd7eaff3 (diff) | |
parent | 22fe2791b6a6e92cc4d0ad953363120b51bd6e2c (diff) |
Handle merge conflicts with jenny work
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 2e6ea1faa..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 : @@ -155,7 +157,7 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() Doc.AddDocToList(recent, "data", doc, undefined, true, true); } }); - this.props.select(false); + this.isAnyChildContentActive() && this.props.select(false); return true; } } |