aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorHannah Chow <hannah_chow@brown.edu>2019-03-06 12:07:38 -0500
committerHannah Chow <hannah_chow@brown.edu>2019-03-06 12:07:38 -0500
commitd3ae5b8273a7aecabc36631b11efed4f634878f2 (patch)
tree4db820aa62dd46e3fd9e7ab6b33dd9b7795750a1 /src/client/views/DocumentDecorations.tsx
parent0ba2f7c42e25dd365c0810d5a1abb948c1db769b (diff)
simple linking done
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 29a4bbcf1..22d34127d 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -1,4 +1,4 @@
-import { observable, computed } from "mobx";
+import { observable, computed, action } from "mobx";
import React = require("react");
import { SelectionManager } from "../util/SelectionManager";
import { observer } from "mobx-react";
@@ -197,6 +197,18 @@ export class DocumentDecorations extends React.Component {
console.log("DocumentDecorations: Bounds Error")
return (null);
}
+
+ let linkButton = null;
+ if (SelectionManager.SelectedDocuments().length > 0) {
+ linkButton = (<Flyout
+ anchorPoint={anchorPoints.RIGHT_TOP}
+ content={
+ <LinkMenu docView={SelectionManager.SelectedDocuments()[0]}>
+ </LinkMenu>
+ }>
+ <div id="linkButton" onPointerDown={this.onLinkButtonDown} ref={this._linkButton}></div>
+ </Flyout>);
+ }
return (
<div id="documentDecorations-container" style={{
width: (bounds.r - bounds.x + 40) + "px",
@@ -214,16 +226,7 @@ export class DocumentDecorations extends React.Component {
<div id="documentDecorations-bottomResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div>
<div id="documentDecorations-bottomRightResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div>
- <Flyout
- anchorPoint={anchorPoints.RIGHT_TOP}
- content={
- <LinkMenu docView={SelectionManager.SelectedDocuments()[0]}>
- </LinkMenu>
- }
-
- >
- <div id="linkButton" onPointerDown={this.onLinkButtonDown} ref={this._linkButton}></div>
- </Flyout>
+ {linkButton}
</div >
)