aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorStanley Yip <33562077+yipstanley@users.noreply.github.com>2019-11-16 14:34:33 -0500
committerGitHub <noreply@github.com>2019-11-16 14:34:33 -0500
commit2231fc61a0a667c207ec3ca7156f7545cf909d17 (patch)
treec3ef95f57ff84c847aedd0125173b6c58cbeb239 /src/client/views/DocumentDecorations.tsx
parent22d1e65236bae11c508d5c34ebcbddd1a552bfd8 (diff)
parent68c9c230b3c98ec70adaa1dacb66215f09d2c1f6 (diff)
Merge pull request #302 from browngraphicslab/interaction_stanley
Interaction Improvements
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 890c32bcb..210fa40dc 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -24,6 +24,7 @@ import { DocumentView } from "./nodes/DocumentView";
import { FieldView } from "./nodes/FieldView";
import { IconBox } from "./nodes/IconBox";
import React = require("react");
+import { PointData } from '../../new_fields/InkField';
import { DocumentType } from '../documents/DocumentTypes';
const higflyout = require("@hig/flyout");
export const { anchorPoints } = higflyout;
@@ -203,7 +204,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
document.removeEventListener("pointerup", this.onBackgroundUp);
document.removeEventListener("pointermove", this.onTitleMove);
document.removeEventListener("pointerup", this.onTitleUp);
- DragManager.StartDocumentDrag(SelectionManager.SelectedDocuments().map(docView => docView.ContentDiv!), dragData, e.x, e.y, {
+ DragManager.StartDocumentDrag(SelectionManager.SelectedDocuments().map(documentView => documentView.ContentDiv!), dragData, e.x, e.y, {
handlers: { dragComplete: action(() => this._hidden = this.Interacting = false) },
hideSource: true
});
@@ -528,7 +529,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
@computed
get selectionTitle(): string {
if (SelectionManager.SelectedDocuments().length === 1) {
- let field = SelectionManager.SelectedDocuments()[0].props.Document[this._fieldKey];
+ let selected = SelectionManager.SelectedDocuments()[0];
+ let field = selected.props.Document[this._fieldKey];
if (typeof field === "string") {
return field;
}
@@ -560,6 +562,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
}
let minimizeIcon = (
<div className="documentDecorations-minimizeButton" onPointerDown={this.onMinimizeDown}>
+ {/* Currently, this is set to be enabled if there is no ink selected. It might be interesting to think about minimizing ink if it's useful? -syip2*/}
{SelectionManager.SelectedDocuments().length === 1 ? IconBox.DocumentIcon(StrCast(SelectionManager.SelectedDocuments()[0].props.Document.layout, "...")) : "..."}
</div>);