aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/util/DocumentManager.ts17
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.scss6
2 files changed, 17 insertions, 6 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index bb87d09ec..84f4d7fa2 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -89,17 +89,26 @@ export class DocumentManager {
let linksList = LinkManager.Instance.findAllRelatedLinks(dv.props.Document);
if (linksList && linksList.length) {
pairs.push(...linksList.reduce((pairs, link) => {
- if (link) {
- let destination = LinkManager.Instance.findOppositeAnchor(link, dv.props.Document);
- if (destination) {
- DocumentManager.Instance.getDocumentViews(destination).map(docView1 => {
+ // if (link) {
+ let destination = LinkManager.Instance.findOppositeAnchor(link, dv.props.Document);
+ // console.log("FINDING FOR", StrCast(dv.Document.title), StrCast(destination.title));
+
+ if (destination) {
+ let dvs = DocumentManager.Instance.getDocumentViews(destination);
+ if (dvs.length > 0) {
+ dvs.map(docView1 => {
// console.log("PUSHING LINK BETWEEN", StrCast(dv.props.Document.title), StrCast(docView1.props.Document.title));
// TODO: if any docviews are not in the same context, draw a proxy
// let sameContent = dv.props.ContainingCollectionView === docView1.props.ContainingCollectionView;
pairs.push({ anchor1View: dv, anchor2View: docView1, linkDoc: link });
+ // console.log("PUSHED", StrCast(dv.props.Document.title), StrCast(docView1.Document.title));
});
+ } else {
+ let dv = DocumentManager.Instance.getDocumentView(destination);
+ dv ? console.log(StrCast(dv.props.Document.title)) : console.log("cant find");
}
}
+ // }
return pairs;
}, [] as { anchor1View: DocumentView, anchor2View: DocumentView, linkDoc: Doc }[]));
}
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.scss b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.scss
index d8d518147..0cd4338e5 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.scss
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinkView.scss
@@ -33,14 +33,16 @@
width: 200px;
height: 100px;
border-radius: 5px;
+ border: 2px solid black;
padding: 10px;
position: relative;
- background-color: black;
+ background-color: white;
+ text-align: center;
cursor: pointer;
p {
width: calc(100% - 20px);
- color: white;
+ color: black;
position: absolute;
top: 50%;
left: 50%;