aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-11-14 23:39:52 -0500
committerFawn <fangrui_tong@brown.edu>2019-11-14 23:39:52 -0500
commitf108bc9f9f1ff9cad2db4b794e3b433768c342a1 (patch)
treea2603e85291d118bbea3370ce823ab833e63281a /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
parente3f06e390f98cc5b97d63fc287daff994d5fef6f (diff)
parentc9fbdb9cfd5fcf35f7a599706cb41d4e7e586e19 (diff)
merged with master
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
index 962fe2a1c..837413842 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
@@ -17,10 +17,12 @@ export interface CollectionFreeFormLinkViewProps {
@observer
export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFormLinkViewProps> {
@observable _alive: number = 0;
+ @observable _opacity: number = 1;
@action
componentDidMount() {
this._alive = 1;
setTimeout(this.rerender, 50);
+ setTimeout(action(() => this._opacity = 0.05), 50);
}
@action
componentWillUnmount() {
@@ -42,6 +44,7 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
let pt1 = Utils.getNearestPointInPerimeter(a.left, a.top, a.width, a.height, b.left + b.width / 2, b.top + b.height / 2);
let pt2 = Utils.getNearestPointInPerimeter(b.left, b.top, b.width, b.height, a.left + a.width / 2, a.top + a.height / 2);
return (<line key="linkLine" className="collectionfreeformlinkview-linkLine"
+ style={{ opacity: this._opacity }}
x1={`${pt1[0]}`} y1={`${pt1[1]}`}
x2={`${pt2[0]}`} y2={`${pt2[1]}`} />);
}