aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/PresentationView.tsx
diff options
context:
space:
mode:
authormadelinegr <mgriswold99@gmail.com>2019-03-11 20:03:32 -0400
committermadelinegr <mgriswold99@gmail.com>2019-03-11 20:03:32 -0400
commitc584f6717f44beca7fbf6862d154a2fc532b2e67 (patch)
tree0a4a6eff653b733892b4f87e5d3e7f1e83d147d2 /src/client/views/PresentationView.tsx
parente502c8fd15951e8b724ec98bef32294e4a6faa5f (diff)
click to navigate to doc
Diffstat (limited to 'src/client/views/PresentationView.tsx')
-rw-r--r--src/client/views/PresentationView.tsx22
1 files changed, 17 insertions, 5 deletions
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<PresViewProps> {
+ //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<PresViewProps> {
// 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 <li className="presentationView-item" key={document.Id}>
- {title.Data}</li>;
+ return <li className="presentationView-item" key={document.Id} onClick={() => this.openDoc(document)} >
+ <div className="presentationView-header" >{title.Data}</div>
+ <div className="presentation-icon">X</div></li>;
}
}
render() {
- var children = this.props.Document.GetT<ListField<Document>>(KeyStore.Data, ListField);
+ const children = this.props.Document.GetT<ListField<Document>>(KeyStore.Data, ListField);
if (children && children !== "<Waiting>") {
return (<div>
@@ -130,8 +141,9 @@ export class PresentationView extends React.Component<PresViewProps> {
let width = this.props.Document.GetNumber(KeyStore.Width, 0);
return (
<div className="presentationView-cont" style={{ width: width }}>
- <div className="presentationView-title"><h2>{titleStr}</h2>
- <p className='icon' onClick={this.closePresentation}>X</p></div>
+ <div className="presentationView-heading">
+ <div className="presentationView-title">{titleStr}</div>
+ <div className='presentation-icon' onClick={this.closePresentation}>X</div></div>
<ul>
<PresentationViewItem
Document={this.props.Document}