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.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 3bae2881e..1c2ffab1b 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -250,7 +250,7 @@ export class DocumentManager {
const options = optionsIn;
Doc.MyRecentlyClosed && Doc.RemoveDocFromList(Doc.MyRecentlyClosed, undefined, targetDoc);
const docContextPath = DocumentManager.GetContextPath(targetDoc, true);
- if (docContextPath.some(doc => doc.hidden)) options.toggleTarget = false;
+ if (docContextPath.some(doc => doc !== targetDoc && doc.hidden)) options.toggleTarget = false;
let activatedTab = false;
if (DocumentView.activateTabView(docContextPath[0])) {
options.toggleTarget = false;
@@ -274,6 +274,7 @@ export class DocumentManager {
// even if we found the document view, if the target is a lightbox, we try to open it in the lightbox to preserve lightbox semantics (eg, there's only one active doc in the lightbox)
const target = DocCast(targetDoc.annotationOn, targetDoc)!;
const compView = this.getDocumentView(DocCast(target.embedContainer))?.ComponentView;
+ options.didMove = target.hidden || options.didMove ? true : false;
if ((compView?.addDocTab ?? compView?._props.addDocTab)?.(target, options.openLocation)) {
await new Promise<void>(waitres => {
setTimeout(() => waitres());
@@ -349,7 +350,7 @@ export class DocumentManager {
// bcz: should this delay be an options parameter?
setTimeout(() => {
Doc.linkFollowHighlight(viewSpec ? [docView.Document, viewSpec] : docView.Document, undefined, options.effect);
- const zoomableText = StrCast(targetDoc.text_html, StrCast(targetDoc.ai_firefly_prompt));
+ const zoomableText = StrCast(targetDoc.text_html, StrCast(targetDoc.ai_prompt));
if (options.zoomTextSelections && Doc.IsUnhighlightTimerSet() && contextView && zoomableText) {
// if the docView is a text anchor, the contextView is the PDF/Web/Text doc
contextView.setTextHtmlOverlay(zoomableText, options.effect);