aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
diff options
context:
space:
mode:
authorFawn <fangrui_tong@brown.edu>2019-06-19 12:50:58 -0400
committerFawn <fangrui_tong@brown.edu>2019-06-19 12:50:58 -0400
commitf362dbfc237536c6c4a8c6d088c3dc818080f7c2 (patch)
tree99088a6afb1a26752a808d249eff40e2818639ed /src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
parent8e5afb5bbb47324a381b5184254e77eba7bd8536 (diff)
both tail ends of a cut link appear on hover/focus of an anchor
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
index 4d477454b..f995a35e3 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.tsx
@@ -18,8 +18,6 @@ export interface CollectionFreeFormLinkViewProps {
sourceView: DocumentView;
targetView: DocumentView;
- sameContext: boolean;
- addDocTab: (document: Doc, where: string) => void;
}
@observer
@@ -44,12 +42,6 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
// }
// }
- followButton = (e: React.PointerEvent): void => {
- // TODO: would be nicer to open docview in context
- e.stopPropagation();
- console.log("follow");
- this.props.addDocTab(this.props.targetView.props.Document, "onRight");
- }
render() {
// let l = this.props.LinkDocs;
@@ -62,25 +54,14 @@ export class CollectionFreeFormLinkView extends React.Component<CollectionFreeFo
let x2 = NumCast(a2.Document.x) + (BoolCast(a2.Document.isMinimized, false) ? 5 : NumCast(a2.Document.width) / NumCast(a2.Document.zoomBasis, 1) / 2);
let y2 = NumCast(a2.Document.y) + (BoolCast(a2.Document.isMinimized, false) ? 5 : NumCast(a2.Document.height) / NumCast(a2.Document.zoomBasis, 1) / 2);
- if (!this.props.sameContext) {
- x2 = x1 + 300;
- y2 = y1 - 300;
- }
-
- let containing = "";
- if (this.props.targetView.props.ContainingCollectionView) {
- containing = StrCast(this.props.targetView.props.ContainingCollectionView.props.Document.title);
- }
- let text = "link to " + StrCast(this.props.targetView.props.Document.title) + (containing === "" ? "" : (" in the context of " + containing));
return (
<>
<line className="collectionfreeformlinkview-linkLine"
style={{ strokeWidth: `${2 * 1 / 2}` }}
x1={`${x1}`} y1={`${y1}`}
x2={`${x2}`} y2={`${y2}`} />
- {!this.props.sameContext ? <circle className="collectionfreeformlinkview-linkCircle" cx={x2} cy={y2} r={20} onPointerDown={this.followButton}></circle> : <></>}
- {!this.props.sameContext ? <text textAnchor="middle" className="collectionfreeformlinkview-linkText" x={`${x2}`} y={`${y2}`}> {text}</text> : <></>}
+
{/* <circle key="linkCircle" className="collectionfreeformlinkview-linkCircle"
cx={(x1 + x2) / 2} cy={(y1 + y2) / 2} r={8} onPointerDown={this.onPointerDown} /> */}
{/* <text key="linkText" textAnchor="middle" className="collectionfreeformlinkview-linkText" x={`${(x1 + x2) / 2}`} y={`${(y1 + y2) / 2}`}>