From c584f6717f44beca7fbf6862d154a2fc532b2e67 Mon Sep 17 00:00:00 2001 From: madelinegr Date: Mon, 11 Mar 2019 20:03:32 -0400 Subject: click to navigate to doc --- src/client/views/PresentationView.scss | 32 ++++++++++++++++++++++---------- src/client/views/PresentationView.tsx | 22 +++++++++++++++++----- src/client/views/nodes/DocumentView.tsx | 4 ++++ 3 files changed, 43 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/views/PresentationView.scss b/src/client/views/PresentationView.scss index 595cdb879..cf49797ce 100644 --- a/src/client/views/PresentationView.scss +++ b/src/client/views/PresentationView.scss @@ -9,7 +9,7 @@ } .presentationView-item { - width: 10vw; + width: 220px; height: 40px; vertical-align: center; padding-top: 15px; @@ -27,15 +27,27 @@ background: #AAAAAA } -.presentationView-title { +.presentationView-heading { margin-top: 0px; - padding-top: 3px; - padding-bottom: 3px; - height: 50px; - text-align: center; + height: 40px; background: lightseagreen; + padding: 30px; } - -.icon{ - margin-right: 0px; -} \ No newline at end of file +.presentationView-title { + padding-top: 3px; + padding-bottom: 3px; + font-size: 25px; + float:left; +} +.presentation-icon{ + float: right; + display: inline; + width: 10px; + margin-top: 7px; +} +.presentationView-header { + padding-top: 1px; + padding-bottom: 1px; + font-size: 15px; + float:left; + } \ No newline at end of file diff --git a/src/client/views/PresentationView.tsx b/src/client/views/PresentationView.tsx index 76431dc9a..4e68ebfc9 100644 --- a/src/client/views/PresentationView.tsx +++ b/src/client/views/PresentationView.tsx @@ -11,6 +11,8 @@ import "./PresentationView.scss" import { mobxPendingDecorators } from "mobx/lib/internal"; import { NumberField } from "../../fields/NumberField"; import "./Main.tsx"; +import { CollectionFreeFormView } from "./collections/CollectionFreeFormView"; +import { DocumentManager } from "../util/DocumentManager"; export interface PresViewProps { Document: Document; @@ -23,6 +25,14 @@ export interface PresViewProps { */ class PresentationViewItem extends React.Component { + //look at CollectionFreeformView.focusDocument(d) + @action + openDoc = (doc: Document) => { + let docView = DocumentManager.Instance.getDocumentView(doc); + if (docView) { + docView.focus(); + } + } /** * Renders a single child document. It will just append a list element. @@ -38,13 +48,14 @@ class PresentationViewItem extends React.Component { // finally, if it's a normal document, then render it as such. else { //TODO: there is a zoom event that will be merged for on click - return
  • - {title.Data}
  • ; + return
  • this.openDoc(document)} > +
    {title.Data}
    +
    X
  • ; } } render() { - var children = this.props.Document.GetT>(KeyStore.Data, ListField); + const children = this.props.Document.GetT>(KeyStore.Data, ListField); if (children && children !== "") { return (
    @@ -130,8 +141,9 @@ export class PresentationView extends React.Component { let width = this.props.Document.GetNumber(KeyStore.Width, 0); return (
    -

    {titleStr}

    -

    X

    +
    +
    {titleStr}
    +
    X
      { SelectionManager.SelectDoc(this, e.ctrlKey); } + focus = () => { + this.props.focus(this.props.Document); + } + get mainContent() { return