From 5726d19a615385b0bcdf1e3a944056d31074edbb Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 10 May 2020 17:02:04 -0400
Subject: made opening docs on right not create aliases.  made clicking on an
 original document trigger replacing it with an alias.

---
 .../collections/collectionFreeForm/CollectionFreeFormView.tsx      | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index ed3e50f45..61081618a 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -339,6 +339,13 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
         }
         this._hitCluster = this.props.Document.useClusters ? this.pickCluster(this.getTransform().transformPoint(e.clientX, e.clientY)) !== -1 : false;
         if (e.button === 0 && (!e.shiftKey || this._hitCluster) && !e.altKey && !e.ctrlKey && this.props.active(true)) {
+
+            if (!this.props.Document.aliasOf && !this.props.ContainingCollectionView) {
+                this.props.addDocTab(this.props.Document, "replace");
+                e.stopPropagation();
+                e.preventDefault();
+                return;
+            }
             document.removeEventListener("pointermove", this.onPointerMove);
             document.removeEventListener("pointerup", this.onPointerUp);
             document.addEventListener("pointermove", this.onPointerMove);
-- 
cgit v1.2.3-70-g09d2

