From 1e8240e9ca1c2e2ff0e02ffb8b43be8dcbba9d14 Mon Sep 17 00:00:00 2001 From: Monika Hedman Date: Wed, 13 Feb 2019 20:57:12 -0500 Subject: nav working --- src/client/views/nodes/DocumentView.tsx | 19 +++++++++++++++++-- src/client/views/nodes/NodeView.scss | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index bc27c424c..f653919cf 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -1,5 +1,6 @@ import { action, computed } from "mobx"; import { observer } from "mobx-react"; +import { observable } from "mobx"; import { Document } from "../../../fields/Document"; import { Opt, FieldWaiting } from "../../../fields/Field"; import { Key, KeyStore } from "../../../fields/Key"; @@ -38,7 +39,14 @@ export interface DocumentViewProps { export class DocumentView extends React.Component { public Id: string = Utils.GenerateGuid(); - public tempTitle: string = "hello there" + + @observable + public Border: string = "white" + + @action + public switchColor() { + this.Border = "red" + } private _mainCont = React.createRef(); get MainContent() { @@ -172,6 +180,12 @@ export class DocumentView extends React.Component { ContextMenu.Instance.displayMenu(e.pageX - 15, e.pageY - 15) } + @action + Center = (e: React.MouseEvent): void => { + //DocumentManager.Instance.centerNode() + console.log("centering...") + } + @action onContextMenu = (e: React.MouseEvent): void => { if (!SelectionManager.IsSelected(this)) { @@ -193,6 +207,7 @@ export class DocumentView extends React.Component { e.stopPropagation(); ContextMenu.Instance.clearItems(); + ContextMenu.Instance.addItem({ description: "Center", event: this.Center }) ContextMenu.Instance.addItem({ description: "Full Screen", event: this.fullScreenClicked }) ContextMenu.Instance.addItem({ description: "Open Right", event: this.openRight }) ContextMenu.Instance.addItem({ description: "Delete", event: this.deleteClicked }) @@ -268,7 +283,7 @@ export class DocumentView extends React.Component { var height = this.props.Document.GetNumber(KeyStore.NativeHeight, 0); var strheight = height > 0 ? height.toString() + "px" : "100%"; return ( -