aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
authorLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-09 22:05:56 -0700
committerLionel Han <47760119+IGoByJoe@users.noreply.github.com>2020-09-09 22:05:56 -0700
commit3fb12589faba5240c3cf3cfc27eac29e7e6fbcdd (patch)
treee5bf573811cc38fab563ae4d9321fad7cdbe0605 /src/client/views/collections
parent92d6a7c800c2a76115b9621f0051f344ada8a6fa (diff)
parent5a4dad460f611cb8138faf08796dda4763f4daf4 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into new_audio
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx12
1 files changed, 7 insertions, 5 deletions
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);