diff options
| author | Sam Wilkins <35748010+samwilkins333@users.noreply.github.com> | 2019-07-27 16:49:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-27 16:49:07 -0400 |
| commit | 6c94ca5149c5d1c4b4bd90b1326560565df8117f (patch) | |
| tree | 060976e1ed80f97f90ad83a4b1821b79046b786d /src/client/views/DocumentDecorations.tsx | |
| parent | 7f8281ca3b6fdbda7dae624bcad307d3ccdcac7b (diff) | |
| parent | a75494ad339b656242dab033f86cbeb13dc882b8 (diff) | |
Merge pull request #217 from browngraphicslab/context_menu
Context menu UI overhaul and added undo to linking via dragging and a few smaller functions
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index c08a84742..751b64c35 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -54,6 +54,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> private _downY = 0; private _iconDoc?: Doc = undefined; private _resizeUndo?: UndoManager.Batch; + private _linkDrag?: UndoManager.Batch; @observable private _minimizedX = 0; @observable private _minimizedY = 0; @observable private _title: string = ""; @@ -376,7 +377,16 @@ 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); |
