aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-07-27 23:38:55 -0400
committerFawn <fangrui_tong@brown.edu>2019-07-27 23:38:55 -0400
commit1c7ae29e05e2a7c6ad75d3edb6a9ea17ed36e523 (patch)
tree68d5baa8a501a5b511e21630657c7e15a148a573 /src/client/views/DocumentDecorations.tsx
parentcf4da743cc82357b4018184d026a07f715f61ad5 (diff)
parent73d30f20e5d38104424c47845a28e860070e4159 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into schema_view_improvements_2
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index ee16938ff..40f2c3da9 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -378,16 +378,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
}
}
- endLinkDragBatch = () => {
- if (!this._linkDrag) {
- return;
- }
- this._linkDrag.end();
- this._linkDrag = undefined;
- }
-
onLinkerButtonDown = (e: React.PointerEvent): void => {
- this._linkDrag = UndoManager.StartBatch("Drag Link");
e.stopPropagation();
document.removeEventListener("pointermove", this.onLinkerButtonMoved);
document.addEventListener("pointermove", this.onLinkerButtonMoved);
@@ -424,9 +415,15 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
let container = selDoc.props.ContainingCollectionView ? selDoc.props.ContainingCollectionView.props.Document.proto : undefined;
let dragData = new DragManager.LinkDragData(selDoc.props.Document, container ? [container] : []);
FormattedTextBox.InputBoxOverlay = undefined;
+ this._linkDrag = UndoManager.StartBatch("Drag Link");
DragManager.StartLinkDrag(this._linkerButton.current, dragData, e.pageX, e.pageY, {
handlers: {
- dragComplete: action(emptyFunction),
+ dragComplete: () => {
+ if (this._linkDrag) {
+ this._linkDrag.end();
+ this._linkDrag = undefined;
+ }
+ },
},
hideSource: false
});
@@ -679,6 +676,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
linkButton = (<Flyout
anchorPoint={anchorPoints.RIGHT_TOP}
content={<LinkMenu docView={selFirst}
+ addDocTab={selFirst.props.addDocTab}
changeFlyout={this.changeFlyoutContent} />}>
<div className={"linkButton-" + (linkCount ? "nonempty" : "empty")} onPointerDown={this.onLinkButtonDown} >{linkCount}</div>
</Flyout >);