From 675d619bcac9b73893406ac029a4fd6c1cc290c6 Mon Sep 17 00:00:00 2001 From: madelinegr Date: Tue, 26 Feb 2019 17:03:28 -0500 Subject: worked on collapsable --- src/client/views/Main.tsx | 2 +- src/client/views/PresentationView.tsx | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/client/views') diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index be6fe304a..eac713387 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -132,7 +132,7 @@ Documents.initProtos(() => { ContainingCollectionView={undefined} /> - +
diff --git a/src/client/views/PresentationView.tsx b/src/client/views/PresentationView.tsx index 0a9183023..d9d9715fc 100644 --- a/src/client/views/PresentationView.tsx +++ b/src/client/views/PresentationView.tsx @@ -18,10 +18,6 @@ export interface PresViewProps { */ class PresentationViewItem extends React.Component { - //observable means render is re-called every time variable is changed - @observable - collapsed: boolean = false; - //TODO: this var isn't needed /** * Renders a single child document. It will just append a list element. @@ -58,6 +54,10 @@ class PresentationViewItem extends React.Component { export class PresentationView extends React.Component { public static Instance: PresentationView; + //observable means render is re-called every time variable is changed + @observable + collapsed: boolean = false; + /** * Adds a document to the presentation view **/ @@ -72,7 +72,7 @@ export class PresentationView extends React.Component { } //TODO: open presentation view if not already open - Documents.PresentationView([], { width: 200, height: 200, title: "a feeform collection" }) + this.collapsed = false; } /** @@ -100,13 +100,14 @@ export class PresentationView extends React.Component { } render() { - let titleStr = ""; + let titleStr = "Title"; let title = this.props.Document.GetT(KeyStore.Title, TextField); if (title && title !== "") { titleStr = title.Data; } + let width = this.collapsed ? 0 : 100; return ( -
+

{titleStr}