aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/collections/collectionFreeForm/MarqueeView.tsx34
1 files changed, 9 insertions, 25 deletions
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
index 23f9bc69e..2092ecb7a 100644
--- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
+++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx
@@ -208,28 +208,15 @@ export class MarqueeView extends React.Component<SubCollectionViewProps & Marque
@action
onPointerDown = (e: React.PointerEvent): void => {
- // if (this.props.pointerEvents?.() === 'none') return;
this._downX = this._lastX = e.clientX;
this._downY = this._lastY = e.clientY;
- const scrollMode = e.altKey ? (Doc.UserDoc().freeformScrollMode === freeformScrollMode.Pan ? freeformScrollMode.Zoom : freeformScrollMode.Pan) : Doc.UserDoc().freeformScrollMode;
- if (!(e.nativeEvent as any).marqueeHit) {
- (e.nativeEvent as any).marqueeHit = true;
- // allow marquee
- if (
- e.button === 2 || //if right drag
- e.metaKey || // or meta drag
- scrollMode === freeformScrollMode.Pan // or pan mode
- ) {
- // if (e.altKey || (MarqueeView.DragMarquee && this.props.active(true))) {
- this.setPreviewCursor(e.clientX, e.clientY, true, false, this.props.Document);
- // (!e.altKey) && e.stopPropagation(); // bcz: removed so that you can alt-click on button in a collection to switch link following behaviors.
- e.preventDefault();
- // }
- // bcz: do we need this? it kills the context menu on the main collection if !altKey
- // e.stopPropagation();
- } else PreviewCursor.Visible = false;
- }
+ const scrollMode = e.altKey ? (Doc.UserDoc().freeformScrollMode === freeformScrollMode.Pan ? freeformScrollMode.Zoom : freeformScrollMode.Pan) : Doc.UserDoc().freeformScrollMode;
+ // allow marquee if right drag/meta drag, or pan mode
+ if (e.button === 2 || e.metaKey || scrollMode === freeformScrollMode.Pan) {
+ this.setPreviewCursor(e.clientX, e.clientY, true, false, this.props.Document);
+ e.preventDefault();
+ } else PreviewCursor.Visible = false;
};
@action
@@ -327,12 +314,9 @@ export class MarqueeView extends React.Component<SubCollectionViewProps & Marque
if (this.props.pointerEvents?.() === 'none') return;
if (Utils.isClick(e.clientX, e.clientY, this._downX, this._downY, Date.now())) {
if (Doc.ActiveTool === InkTool.None) {
- if (!(e.nativeEvent as any).marqueeHit) {
- (e.nativeEvent as any).marqueeHit = true;
- if (!this.props.trySelectCluster(e.shiftKey)) {
- !DocumentView.ExploreMode && this.setPreviewCursor(e.clientX, e.clientY, false, false, this.props.Document);
- } else e.stopPropagation();
- }
+ if (!this.props.trySelectCluster(e.shiftKey)) {
+ !DocumentView.ExploreMode && this.setPreviewCursor(e.clientX, e.clientY, false, false, this.props.Document);
+ } else e.stopPropagation();
}
// let the DocumentView stopPropagation of this event when it selects this document
} else {