aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-03-22 17:46:39 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-03-22 17:46:39 -0400
commitf80f5c69fc538b8f8614bfab600e4b82236bb096 (patch)
tree01d144f63d3a215fbbc9731172da1013648a0e83 /src/client/util/DocumentManager.ts
parent4265feca9e63cad6067055497ecabd354ead84f4 (diff)
parent2a4e86be98ad0f8d4aa4cb09b982d448b542d916 (diff)
Merge branch 'master' into collaboration-sarah
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index c670d0ab8..947613801 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -265,6 +265,7 @@ export class DocumentManager {
let rootContextView = await new Promise<DocumentView>(res => {
const viewIndex = docContextPath.findIndex(doc => this.getDocumentView(doc));
if (viewIndex !== -1) return res(this.getDocumentView(docContextPath[viewIndex])!);
+ options.didMove = true;
docContextPath.some(doc => TabDocView.Activate(doc)) || MainView.addDocTabFunc(docContextPath[0], options.openLocation as OpenWhere);
this.AddViewRenderedCb(docContextPath[0], dv => res(dv));
});
@@ -286,7 +287,7 @@ export class DocumentManager {
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(docView);
- if (!childDocView) return { viewSpec: viewSpec ?? docView.rootDoc, docView, contextView };
+ if (!childDocView) return { viewSpec: options.anchorDoc ?? viewSpec ?? docView.rootDoc, docView, contextView };
contextView = docView;
docView = childDocView;
}
@@ -299,7 +300,7 @@ export class DocumentManager {
PresBox.restoreTargetDocView(docView, viewSpec, options.zoomTime ?? 500);
Doc.linkFollowHighlight(docView.rootDoc, undefined, options.effect);
if (options.playAudio) DocumentManager.playAudioAnno(docView.rootDoc);
- if (options.toggleTarget) docView.rootDoc.hidden = !docView.rootDoc.hidden;
+ if (options.toggleTarget && (!options.didMove || docView.rootDoc.hidden)) docView.rootDoc.hidden = !docView.rootDoc.hidden;
if (options.effect) docView.rootDoc[AnimationSym] = options.effect;
if (options.zoomTextSelections && Doc.UnhighlightTimer && contextView && viewSpec.textHtml) {