From fa89fbf06f3d27ff0ca3f62fa6e6ab4fe378edf1 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 5 Dec 2019 11:29:51 -0500 Subject: oops. fixed mobx problem with library path. --- .../views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 4 +++- src/client/views/nodes/ContentFittingDocumentView.tsx | 2 ++ src/new_fields/util.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index c3e064da5..0d3748ded 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -622,12 +622,14 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) { getScale = () => this.Document.scale || 1; + @computed get libraryPath() { return this.props.LibraryPath ? [...this.props.LibraryPath, this.props.Document] : []; } + getChildDocumentViewProps(childLayout: Doc, childData?: Doc): DocumentViewProps { return { ...this.props, DataDoc: childData, Document: childLayout, - LibraryPath: this.props.LibraryPath ? [...this.props.LibraryPath, this.props.Document] : [], + LibraryPath: this.libraryPath, layoutKey: undefined, ruleProvider: this.Document.isRuleProvider && childLayout.type !== DocumentType.TEXT ? this.props.Document : this.props.ruleProvider, //bcz: hack! - currently ruleProviders apply to documents in nested colleciton, not direct children of themselves onClick: undefined, // this.props.onClick, // bcz: check this out -- I don't think we want to inherit click handlers, or we at least need a way to ignore them diff --git a/src/client/views/nodes/ContentFittingDocumentView.tsx b/src/client/views/nodes/ContentFittingDocumentView.tsx index 86fab0ba0..660a5bb7e 100644 --- a/src/client/views/nodes/ContentFittingDocumentView.tsx +++ b/src/client/views/nodes/ContentFittingDocumentView.tsx @@ -13,6 +13,7 @@ import '../DocumentDecorations.scss'; import { DocumentView } from "../nodes/DocumentView"; import "./ContentFittingDocumentView.scss"; import { CollectionView } from "../collections/CollectionView"; +import { TraceMobx } from "../../../new_fields/util"; interface ContentFittingDocumentViewProps { Document?: Doc; @@ -76,6 +77,7 @@ export class ContentFittingDocumentView extends React.Component {!this.props.Document || !this.props.PanelWidth ? (null) : (