aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-04-26 21:15:15 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-04-26 21:15:15 -0400
commiteda4c4bb78d05ba857ce29ca8f7c463ce51b7609 (patch)
tree337265867d7773d44e6936ae3792ea598f41fc60 /src/client/views/collections/CollectionDockingView.tsx
parent7cda7f95e724bb621c57b5c53b083e6d6245afa5 (diff)
parent3ed3dfe6c02906d28a21af28cfeac406b9889638 (diff)
Merge branch 'newDocs' of github-tsch-brown:browngraphicslab/Dash-Web into newDocs
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index ec5f823b0..69401ceeb 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -7,7 +7,7 @@ import * as ReactDOM from 'react-dom';
import Measure from "react-measure";
import { Utils, returnTrue, emptyFunction, returnOne, returnZero } from "../../../Utils";
import { Server } from "../../Server";
-import { undoBatch } from "../../util/UndoManager";
+import { undoBatch, UndoManager } from "../../util/UndoManager";
import { DocumentView } from "../nodes/DocumentView";
import "./CollectionDockingView.scss";
import React = require("react");
@@ -48,7 +48,11 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
(window as any).React = React;
(window as any).ReactDOM = ReactDOM;
}
+ hack: boolean = false;
+ undohack: any = null;
public StartOtherDrag(dragDocs: Doc[], e: any) {
+ this.hack = true;
+ this.undohack = UndoManager.StartBatch("goldenDrag");
dragDocs.map(dragDoc =>
this.AddRightSplit(dragDoc, true).contentItems[0].tab._dragListener.
onMouseDown({ pageX: e.pageX, pageY: e.pageY, preventDefault: emptyFunction, button: 0 }));
@@ -236,6 +240,10 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
stateChanged = () => {
var json = JSON.stringify(this._goldenLayout.toConfig());
this.props.Document.data = json;
+ if (this.undohack && !this.hack) {
+ this.undohack.end();
+ }
+ this.hack = false;
}
itemDropped = () => {