diff options
| author | bob <bcz@cs.brown.edu> | 2019-04-24 09:56:59 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-04-24 09:56:59 -0400 |
| commit | d2a95b1aa144e8dd4e87338525922dae1f3d9e67 (patch) | |
| tree | 4fda48e270838626ca3c2c0edd1c9bdf7555d840 /src/client/views/collections/collectionFreeForm | |
| parent | 04b177406a98a52f4f8b3f94375f94db2f46a5df (diff) | |
added blacklist to stop docs form linking to their parent collection. refactored drag threshold to Utils
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 06e8a9fc6..39b42dac9 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -13,6 +13,7 @@ import { PreviewCursor } from "../../PreviewCursor"; import { CollectionFreeFormView } from "./CollectionFreeFormView"; import "./MarqueeView.scss"; import React = require("react"); +import { Utils } from "../../../../Utils"; interface MarqueeViewProps { getContainerTransform: () => Transform; @@ -33,7 +34,6 @@ export class MarqueeView extends React.Component<MarqueeViewProps> @observable _downX: number = 0; @observable _downY: number = 0; @observable _visible: boolean = false; - static DRAG_THRESHOLD = 4; @action cleanupInteractions = (all: boolean = false) => { @@ -74,8 +74,8 @@ export class MarqueeView extends React.Component<MarqueeViewProps> this._lastX = e.pageX; this._lastY = e.pageY; if (!e.cancelBubble) { - if (Math.abs(this._lastX - this._downX) > MarqueeView.DRAG_THRESHOLD || - Math.abs(this._lastY - this._downY) > MarqueeView.DRAG_THRESHOLD) { + if (Math.abs(this._lastX - this._downX) > Utils.DRAG_THRESHOLD || + Math.abs(this._lastY - this._downY) > Utils.DRAG_THRESHOLD) { this._visible = true; e.stopPropagation(); e.preventDefault(); @@ -101,8 +101,8 @@ export class MarqueeView extends React.Component<MarqueeViewProps> @action onClick = (e: React.MouseEvent): void => { - if (Math.abs(e.clientX - this._downX) < MarqueeView.DRAG_THRESHOLD && - Math.abs(e.clientY - this._downY) < MarqueeView.DRAG_THRESHOLD) { + if (Math.abs(e.clientX - this._downX) < Utils.DRAG_THRESHOLD && + Math.abs(e.clientY - this._downY) < Utils.DRAG_THRESHOLD) { PreviewCursor.Show(e.clientX, e.clientY, this.onKeyPress); // let the DocumentView stopPropagation of this event when it selects this document } else { // why do we get a click event when the cursor have moved a big distance? |
