diff options
author | bobzel <zzzman@gmail.com> | 2023-03-05 21:30:04 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-03-05 21:30:04 -0500 |
commit | 4c2584baf8bae0cde714c832b0768d3c08864422 (patch) | |
tree | dbbd2ae7348d183328aeded8bba1a06fae56f404 | |
parent | 0c38e4dc096d6abf82ef11286616856b7119c6e1 (diff) |
from last
-rw-r--r-- | src/client/util/DocumentManager.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index 1a38e9aff..c670d0ab8 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -270,9 +270,9 @@ export class DocumentManager { }); docContextPath.shift(); - const childViewIterator = async () => { + const childViewIterator = async (docView: DocumentView) => { const innerDoc = docContextPath.shift(); - return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.unrendered ? (await rootContextView.ComponentView?.getView?.(innerDoc)) ?? this.getDocumentView(innerDoc) : undefined }; + return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.unrendered ? (await docView.ComponentView?.getView?.(innerDoc)) ?? this.getDocumentView(innerDoc) : undefined }; }; const target = await this.focusViewsInPath(rootContextView, options, childViewIterator); this.restoreDocView(target.viewSpec, target.docView, options, target.contextView ?? target.docView, targetDoc); @@ -280,12 +280,12 @@ export class DocumentManager { finished?.(); }; - focusViewsInPath = async (docView: DocumentView, options: DocFocusOptions, iterator: () => Promise<{ viewSpec: Opt<Doc>; childDocView: Opt<DocumentView> }>) => { + focusViewsInPath = async (docView: DocumentView, options: DocFocusOptions, iterator: (docView: DocumentView) => Promise<{ viewSpec: Opt<Doc>; childDocView: Opt<DocumentView> }>) => { let contextView: DocumentView | undefined; // view containing context that contains target while (true) { docView.rootDoc.layoutKey === 'layout_icon' ? await new Promise<void>(res => docView.iconify(res)) : undefined; docView.props.focus(docView.rootDoc, options); // focus the view within its container - const { childDocView, viewSpec } = await iterator(); + const { childDocView, viewSpec } = await iterator(docView); if (!childDocView) return { viewSpec: viewSpec ?? docView.rootDoc, docView, contextView }; contextView = docView; docView = childDocView; |