aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionTreeView.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-04-26 19:30:39 -0700
committerSam Wilkins <samwilkins333@gmail.com>2020-04-26 19:30:39 -0700
commitfb83b7fec0b440cbc2d98c563bf1fab8d4b93908 (patch)
treeace9a6367129202dafa6054ce18655ec4db1f01a /src/client/views/collections/CollectionTreeView.tsx
parentc75ffd4900acea74c55b6bf275a5e8082c15d573 (diff)
parent6a6e56cecbff393a013bd293f1feb5c5f04cb7cc (diff)
merge
Diffstat (limited to 'src/client/views/collections/CollectionTreeView.tsx')
-rw-r--r--src/client/views/collections/CollectionTreeView.tsx20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx
index 49eb90bc2..362d43ee7 100644
--- a/src/client/views/collections/CollectionTreeView.tsx
+++ b/src/client/views/collections/CollectionTreeView.tsx
@@ -348,7 +348,9 @@ class TreeView extends React.Component<TreeViewProps> {
</div></ul>;
} else {
const layoutDoc = Doc.Layout(this.props.document);
- return <div ref={this._dref} style={{ display: "inline-block", height: this.docHeight() }} key={this.props.document[Id] + this.props.document.title}>
+ const panelHeight = layoutDoc.type === DocumentType.RTF ? this.rtfHeight : this.docHeight;
+ const panelWidth = layoutDoc.type === DocumentType.RTF ? this.rtfWidth : this.docWidth;
+ return <div ref={this._dref} style={{ display: "inline-block", height: panelHeight() }} key={this.props.document[Id] + this.props.document.title}>
<ContentFittingDocumentView
Document={layoutDoc}
DataDocument={this.templateDataDoc}
@@ -360,8 +362,8 @@ class TreeView extends React.Component<TreeViewProps> {
FreezeDimensions={true}
NativeWidth={layoutDoc.type === DocumentType.RTF ? this.rtfWidth : undefined}
NativeHeight={layoutDoc.type === DocumentType.RTF ? this.rtfHeight : undefined}
- PanelWidth={layoutDoc.type === DocumentType.RTF ? this.rtfWidth : this.docWidth}
- PanelHeight={layoutDoc.type === DocumentType.RTF ? this.rtfHeight : this.docHeight}
+ PanelWidth={panelWidth}
+ PanelHeight={panelHeight}
getTransform={this.docTransform}
CollectionDoc={this.props.containingCollection}
CollectionView={undefined}
@@ -727,17 +729,19 @@ export class CollectionTreeView extends CollectionSubView<Document, Partial<coll
}
});
});
- const { TextDocument, ImageDocument, CarouselDocument } = Docs.Create;
+ const { TextDocument, ImageDocument, CarouselDocument, TreeDocument } = Docs.Create;
const { Document } = this.props;
const fallbackImg = "http://www.cs.brown.edu/~bcz/face.gif";
const textDoc = TextDocument("", { title: "details", _autoHeight: true });
const detailView = Docs.Create.StackingDocument([
CarouselDocument([], { title: "data", _height: 350, _itemIndex: 0, backgroundColor: "#9b9b9b3F" }),
- textDoc,
- TextDocument("", { title: "shortDescription", _autoHeight: true }),
- TextDocument("", { title: "longDescription", _height: 350 })
- // TreeDocument([], { title: "narratives", _height: 75, treeViewHideTitle: true }),
+ TreeDocument([
+ // textDoc,
+ TextDocument("", { title: "shortDescription", _autoHeight: true }),
+ // TreeDocument([], { title: "narratives", _height: 75, treeViewHideTitle: true }),
+ TextDocument("", { title: "longDescription", _height: 350 })
+ ], { title: "stuff", _height: 100 })
], { _chromeStatus: "disabled", _width: 300, _height: 300, _autoHeight: true, title: "detailView" });
// const detailView = Cast(Cast(Doc.UserDoc()["template-button-detail"], Doc, null)?.dragFactor, Doc, null);
detailView.isTemplateDoc = makeTemplate(detailView);