diff options
author | madelinegr <mgriswold99@gmail.com> | 2019-02-25 18:56:02 -0500 |
---|---|---|
committer | madelinegr <mgriswold99@gmail.com> | 2019-02-25 18:56:02 -0500 |
commit | 9ce2b722ec0fce077a595d3d7bb01f735f1d2c81 (patch) | |
tree | 4832920629fc55e787e40e3a50306c3d7b026fea /src | |
parent | a38a26ac3aa8bbce0dabf8495af29a48e2c039e4 (diff) |
pres view changes and add context menu button
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/PresentationView.tsx | 11 | ||||
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/client/views/PresentationView.tsx b/src/client/views/PresentationView.tsx index 9ba812ba0..bbd3bf71a 100644 --- a/src/client/views/PresentationView.tsx +++ b/src/client/views/PresentationView.tsx @@ -5,7 +5,6 @@ import { ListField } from "../../fields/ListField"; import React = require("react") import { TextField } from "../../fields/TextField"; import { observable, action } from "mobx"; -import "./CollectionTreeView.scss"; export interface PresViewProps { Document: Document; @@ -20,6 +19,7 @@ class PresentationViewItem extends React.Component<PresViewProps> { //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. @@ -54,6 +54,15 @@ class PresentationViewItem extends React.Component<PresViewProps> { @observer export class PresentationView extends React.Component<PresViewProps> { + public static Instance: PresentationView; + + /** + * Adds a document to the presentation view + **/ + @action + public PinDoc(document: Document) { + + } render() { let titleStr = ""; diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 87f2e205b..ae96c4dff 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -18,6 +18,7 @@ import { FormattedTextBox } from "../nodes/FormattedTextBox"; import { ImageBox } from "../nodes/ImageBox"; import "./DocumentView.scss"; import React = require("react"); +import { PresentationView } from "../PresentationView"; const JsxParser = require('react-jsx-parser').default;//TODO Why does this need to be imported like this? export interface DocumentViewProps { @@ -187,6 +188,7 @@ export class DocumentView extends React.Component<DocumentViewProps> { ContextMenu.Instance.addItem({ description: "Full Screen", event: this.fullScreenClicked }) ContextMenu.Instance.addItem({ description: "Open Right", event: () => CollectionDockingView.Instance.AddRightSplit(this.props.Document) }) ContextMenu.Instance.addItem({ description: "Delete", event: this.deleteClicked }) + ContextMenu.Instance.addItem({ description: "Pin to Presentation", event: () => PresentationView.Instance.PinDoc(this.props.Document) }) ContextMenu.Instance.addItem({ description: "Freeform", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Freeform) }) ContextMenu.Instance.addItem({ description: "Schema", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Schema) }) ContextMenu.Instance.addItem({ description: "Treeview", event: () => this.props.Document.SetNumber(KeyStore.ViewType, CollectionViewType.Tree) }) |