aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 6eed4dc86..ea5770b6a 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -143,7 +143,7 @@ export class DocumentManager {
(pass, toReturn) =>
toReturn ??
docViewArray.filter(view => view.rootDoc === doc).find(view => !pass || view.props.docViewPath().lastElement() === preferredCollection) ??
- docViewArray.filter(view => Doc.GetProto(view.rootDoc) === doc).find(view => !pass || view.props.docViewPath().lastElement() === preferredCollection),
+ docViewArray.filter(view => Doc.AreProtosEqual(view.rootDoc, doc)).find(view => !pass || view.props.docViewPath().lastElement() === preferredCollection),
undefined as Opt<DocumentView>
);
}
@@ -189,7 +189,7 @@ export class DocumentManager {
while (
containerDocContext.length &&
containerDocContext[0]?.embedContainer &&
- DocCast(containerDocContext[0].embedContainer)?.viewType !== CollectionViewType.Docking &&
+ DocCast(containerDocContext[0].embedContainer)?.type_collection !== CollectionViewType.Docking &&
(includeExistingViews || !DocumentManager.Instance.getDocumentView(containerDocContext[0]))
) {
containerDocContext = [Cast(containerDocContext[0].embedContainer, Doc, null), ...containerDocContext];
@@ -248,7 +248,10 @@ export class DocumentManager {
if (docContextPath.some(doc => doc.hidden)) options.toggleTarget = false;
let rootContextView = await new Promise<DocumentView>(res => {
const viewIndex = docContextPath.findIndex(doc => this.getDocumentView(doc));
- if (viewIndex !== -1) return res(this.getDocumentView(docContextPath[viewIndex])!);
+ if (viewIndex !== -1) {
+ viewIndex && docContextPath.splice(0, viewIndex);
+ return res(this.getDocumentView(docContextPath[0])!);
+ }
options.didMove = true;
docContextPath.some(doc => TabDocView.Activate(doc)) || DocumentViewInternal.addDocTabFunc(docContextPath[0], options.openLocation ?? OpenWhere.addRight);
this.AddViewRenderedCb(docContextPath[0], dv => res(dv));
@@ -264,7 +267,7 @@ export class DocumentManager {
docContextPath.shift();
const childViewIterator = async (docView: DocumentView) => {
const innerDoc = docContextPath.shift();
- return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.unrendered ? (await docView.ComponentView?.getView?.(innerDoc)) ?? this.getDocumentView(innerDoc) : undefined };
+ return { viewSpec: innerDoc, childDocView: innerDoc && !innerDoc.layout_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);