diff options
author | bob <bcz@cs.brown.edu> | 2019-12-05 11:29:51 -0500 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-12-05 11:29:51 -0500 |
commit | fa89fbf06f3d27ff0ca3f62fa6e6ab4fe378edf1 (patch) | |
tree | 8bac858ff49eb8ab04f29b9c0e693e09266733bd | |
parent | 9a6b4eaef6b16a5a995cb939c33fdd8213d7724c (diff) |
oops. fixed mobx problem with library path.
-rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 4 | ||||
-rw-r--r-- | src/client/views/nodes/ContentFittingDocumentView.tsx | 2 | ||||
-rw-r--r-- | src/new_fields/util.ts | 2 |
3 files changed, 6 insertions, 2 deletions
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<ContentFittingDo @computed get borderRounding() { return StrCast(this.props.Document!.borderRounding); } render() { + TraceMobx(); return (<div className="contentFittingDocumentView" style={{ width: this.props.PanelWidth(), height: this.props.PanelHeight() }}> {!this.props.Document || !this.props.PanelWidth ? (null) : ( <div className="contentFittingDocumentView-previewDoc" diff --git a/src/new_fields/util.ts b/src/new_fields/util.ts index 7bd9ef8da..4147be278 100644 --- a/src/new_fields/util.ts +++ b/src/new_fields/util.ts @@ -13,7 +13,7 @@ function _readOnlySetter(): never { } export function TraceMobx() { - trace(); + //trace(); } export interface GetterResult { |