aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionDockingView.tsx
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-06-25 12:01:16 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-06-25 12:01:16 -0700
commita7c1aaa0600a01d25b6525d4ae17f1a5086847d0 (patch)
tree5f42df8110af8cda0055005d3a7f0c38a3060301 /src/client/views/collections/CollectionDockingView.tsx
parentdb92851456f168affcdbd4053b38e7b9f6b7a97d (diff)
parenta5b836e647f8c356c4b4d37b2cdcd4fa38459b80 (diff)
Merge branch 'mobile_revision_direct' of https://github.com/browngraphicslab/Dash-Web into mobile_revision_direct
Diffstat (limited to 'src/client/views/collections/CollectionDockingView.tsx')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 4e5491df5..79337c9b4 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -11,7 +11,7 @@ import { Id } from '../../../fields/FieldSymbols';
import { FieldId } from "../../../fields/RefField";
import { Cast, NumCast, StrCast } from "../../../fields/Types";
import { TraceMobx } from '../../../fields/util';
-import { emptyFunction, returnOne, returnTrue, Utils, returnZero, returnEmptyFilter } from "../../../Utils";
+import { emptyFunction, returnOne, returnTrue, Utils, returnZero, returnEmptyFilter, setupMoveUpEvents, returnFalse } from "../../../Utils";
import { DocServer } from "../../DocServer";
import { Docs } from '../../documents/Documents';
import { DocumentManager } from '../../util/DocumentManager';
@@ -521,13 +521,15 @@ export class CollectionDockingView extends React.Component<SubCollectionViewProp
tab.setActive(true);
};
const onDown = (e: React.PointerEvent) => {
- if (!(e.nativeEvent as any).defaultPrevented) {
- e.preventDefault();
- e.stopPropagation();
- const dragData = new DragManager.DocumentDragData([doc]);
- dragData.dropAction = doc.dropAction as dropActionType;
- DragManager.StartDocumentDrag([gearSpan], dragData, e.clientX, e.clientY);
- }
+ setupMoveUpEvents(this, e, (e) => {
+ if (!(e as any).defaultPrevented) {
+ const dragData = new DragManager.DocumentDragData([doc]);
+ dragData.dropAction = doc.dropAction as dropActionType;
+ DragManager.StartDocumentDrag([gearSpan], dragData, e.clientX, e.clientY);
+ return true;
+ }
+ return false;
+ }, returnFalse, emptyFunction);
};
tab.buttonDisposer = reaction(() => ((view: Opt<DocumentView>) => view ? [view] : [])(DocumentManager.Instance.getDocumentView(doc)),