aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-04-27 16:27:48 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-04-27 16:27:48 -0400
commit73fb401abe04633112b45691e6e05657a0fbe2dc (patch)
tree4927b94131f1678fb3868158f55ccffa06e7ea7b
parent2169c5f77ffc824305fc438d06c00efb54a28886 (diff)
extended link lines to work for documents nested one-level in collections.
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
index ebdb0c75c..6d6b6e309 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLinksView.tsx
@@ -72,7 +72,15 @@ export class CollectionFreeFormLinksView extends React.Component<CollectionViewP
let equalViews = [view];
let containerDoc = view.props.Document.GetT(KeyStore.AnnotationOn, Document);
if (containerDoc && containerDoc instanceof Document) {
- equalViews = DocumentManager.Instance.getDocumentViews(containerDoc.GetPrototype()!);
+ equalViews.push(...DocumentManager.Instance.getDocumentViews(containerDoc.GetPrototype()!));
+ }
+ if (view.props.ContainingCollectionView) {
+ let collid = view.props.ContainingCollectionView.props.Document.Id;
+ this.props.Document.GetList(this.props.fieldKey, [] as Document[]).
+ filter(child =>
+ child.Id === collid).map(view =>
+ DocumentManager.Instance.getDocumentViews(view).map(view =>
+ equalViews.push(view)));
}
return equalViews.filter(sv => sv.props.ContainingCollectionView && sv.props.ContainingCollectionView.props.Document === this.props.Document);
}