diff options
author | bobzel <zzzman@gmail.com> | 2022-06-03 08:44:03 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-06-03 08:44:03 -0400 |
commit | 19705d01102fbb594ea5df18bb980bd2dfec93d4 (patch) | |
tree | 7714bb19d07dc0af2c3cd536e11326eda323ea35 /src | |
parent | 3e75896a0c6e59036a6b9467521f4fe68fdda1a0 (diff) |
fixed presentation as list index display
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 2 | ||||
-rw-r--r-- | src/client/views/nodes/trails/PresBox.tsx | 4 |
2 files changed, 3 insertions, 3 deletions
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<string>(["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<FieldViewProps>() { // TODO: [AL] add childDocs() and treeMap fields // @computed get childDocs() { return DocListCast(this.rootDoc.presentationaLinearizedDocuments); } //_treeViewMap:Map<number[], Doc> - @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<number, Doc> = new Map<number, Doc>(); @computed get tagDocs() { @@ -2533,7 +2533,7 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() { } // 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; |