From e1d40c330c6981f04c745069d82fe24559af269c Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Fri, 23 Oct 2020 01:58:29 +0800 Subject: multiple trails --- src/client/views/nodes/PresBox.tsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PresBox.tsx b/src/client/views/nodes/PresBox.tsx index d05674d69..47dd83d7b 100644 --- a/src/client/views/nodes/PresBox.tsx +++ b/src/client/views/nodes/PresBox.tsx @@ -767,6 +767,7 @@ export class PresBox extends ViewBoxBaseComponent // Adds the index in the pres path graphically @computed get order() { const order: JSX.Element[] = []; + const docs: Doc[] = []; this.childDocs.filter(doc => Cast(doc.presentationTargetDoc, Doc, null)).forEach((doc, index) => { const tagDoc = Cast(doc.presentationTargetDoc, Doc, null); const srcContext = Cast(tagDoc.context, Doc, null); @@ -774,14 +775,24 @@ export class PresBox extends ViewBoxBaseComponent const height = Math.max(NumCast(tagDoc._height) / 10, 15); const edge = Math.max(width, height); const fontSize = edge * 0.8; - // Case A: Document is contained within the colleciton + // Case A: Document is contained within the collection if (this.rootDoc.presCollection === srcContext) { - order.push( -
-
{index + 1}
-
); + if (docs.includes(tagDoc)) { + docs.push(tagDoc); + order.push( +
+
{index + 1}
+
); + } else { + docs.push(tagDoc); + order.push( +
+
{index + 1}
+
); + } // Case B: Document is not inside of the collection } else { + docs.push(tagDoc); order.push(
{index + 1}
-- cgit v1.2.3-70-g09d2