From 5a4dad460f611cb8138faf08796dda4763f4daf4 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 9 Sep 2020 23:21:05 -0400
Subject: fixed linkEditor menu to show up in the right place.  fixed linklines
 to attach properly.

---
 .../collectionFreeForm/CollectionFreeFormLinkView.tsx        | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

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

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
index 417b4c1ff..8bc3cdf1b 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
@@ -118,7 +118,7 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
             el = el.parentNode;
         } while (el != document.body);
         // Check its within the document viewport
-        return top;//top <= document.documentElement.clientHeight && getComputedStyle(document.documentElement).overflow === "hidden";
+        return top; //top <= document.documentElement.clientHeight && getComputedStyle(document.documentElement).overflow === "hidden";
     };
 
     @computed get renderData() {
@@ -129,10 +129,12 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
         this.props.A.props.ScreenToLocalTransform().transform(this.props.B.props.ScreenToLocalTransform());
         const acont = this.props.A.ContentDiv.getElementsByClassName("linkAnchorBox-cont");
         const bcont = this.props.B.ContentDiv.getElementsByClassName("linkAnchorBox-cont");
-        const a = (acont.length ? acont[0] : this.props.A.ContentDiv).getBoundingClientRect();
-        const b = (bcont.length ? bcont[0] : this.props.B.ContentDiv).getBoundingClientRect();
-        const atop = this.visibleY(this.props.A.ContentDiv);
-        const btop = this.visibleY(this.props.B.ContentDiv);
+        const adiv = (acont.length ? acont[0] : this.props.A.ContentDiv);
+        const bdiv = (bcont.length ? bcont[0] : this.props.B.ContentDiv);
+        const a = adiv.getBoundingClientRect();
+        const b = bdiv.getBoundingClientRect();
+        const atop = this.visibleY(adiv);
+        const btop = this.visibleY(bdiv);
         const apt = Utils.closestPtBetweenRectangles(a.left, atop, a.width, a.height,
             b.left, btop, b.width, b.height,
             a.left + a.width / 2, a.top + a.height / 2);
-- 
cgit v1.2.3-70-g09d2

