From 19705d01102fbb594ea5df18bb980bd2dfec93d4 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 3 Jun 2022 08:44:03 -0400 Subject: fixed presentation as list index display --- src/client/util/CurrentUserUtils.ts | 2 +- src/client/views/nodes/trails/PresBox.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index c4e2afd08..2ed6c3cbe 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -930,7 +930,7 @@ export class CurrentUserUtils { sharedDocs.childContextMenuIcons = new List(["user-plus",]); } - doc.mySharedDocs = new PrefetchProxy(sharedDocs); + doc.mySharedDocs = new PrefetchProxy(sharedDocs as Doc); } } diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx index d85f0b640..f4e792acd 100644 --- a/src/client/views/nodes/trails/PresBox.tsx +++ b/src/client/views/nodes/trails/PresBox.tsx @@ -102,7 +102,7 @@ export class PresBox extends ViewBoxBaseComponent() { // TODO: [AL] add childDocs() and treeMap fields // @computed get childDocs() { return DocListCast(this.rootDoc.presentationaLinearizedDocuments); } //_treeViewMap:Map - @computed get childDocs() { return DocListCast(this.rootDoc.presentationLinearizedDocuments); } + @computed get childDocs() { return this.layoutDoc._viewType === CollectionViewType.Tree ? DocListCast(this.rootDoc.presentationLinearizedDocuments) : DocListCast(this.rootDoc[this.fieldKey]); } @observable _treeViewMap: Map = new Map(); @computed get tagDocs() { @@ -2533,7 +2533,7 @@ export class PresBox extends ViewBoxBaseComponent() { } // this func communicates with PresBoxElement to send information of the doc ScriptingGlobals.add(function lookupPresBoxField(presBoxDoc: Doc, field: string, presEleDoc: Doc) { - if (field === 'indexInPres') return DocListCast(presBoxDoc.presentationLinearizedDocuments).indexOf(presEleDoc); + if (field === 'indexInPres') return DocListCast(presBoxDoc._viewType === CollectionViewType.Tree ? presBoxDoc.presentationLinearizedDocuments : presBoxDoc[StrCast(presBoxDoc.presentationFieldKey)]).indexOf(presEleDoc); if (field === 'presCollapsedHeight') return [CollectionViewType.Tree || CollectionViewType.Stacking].includes(presBoxDoc._viewType as any) ? 35 : 31; if (field === 'presStatus') return presBoxDoc.presStatus; if (field === '_itemIndex') return presBoxDoc._itemIndex; -- cgit v1.2.3-70-g09d2