diff options
author | bobzel <zzzman@gmail.com> | 2024-10-18 01:25:39 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-10-18 01:25:39 -0400 |
commit | cc3bdef579624d489fa6760733d6f9c31b8f2357 (patch) | |
tree | 6f24ba051a6e1f7b4b8af47effd67f11627046ee /src/client/util/DocumentManager.ts | |
parent | 0728e918e6d075c0eda738b7d2fdbf6095c714ae (diff) |
fixed tab switching instead of bringing up a lightbox when following link to doc in different tab.
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r-- | src/client/util/DocumentManager.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index 4ab2e8d05..286112bf9 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -256,7 +256,11 @@ export class DocumentManager { Doc.RemoveDocFromList(Doc.MyRecentlyClosed, undefined, targetDoc); const docContextPath = DocumentManager.GetContextPath(targetDoc, true); if (docContextPath.some(doc => doc.hidden)) options.toggleTarget = false; - if (DocumentView.activateTabView(docContextPath[0])) options.toggleTarget = false; + let activatedTab = false; + if (DocumentView.activateTabView(docContextPath[0])) { + options.toggleTarget = false; + activatedTab = true; + } const rootContextView = docContextPath.length && @@ -268,7 +272,7 @@ export class DocumentManager { return; } options.didMove = true; - (!DocumentView.LightboxDoc() && docContextPath.some(doc => DocumentView.activateTabView(doc))) || DocumentViewInternal.addDocTabFunc(docContextPath[0], options.openLocation ?? OpenWhere.addRight); + (!DocumentView.LightboxDoc() && (activatedTab || docContextPath.some(doc => DocumentView.activateTabView(doc)))) || DocumentViewInternal.addDocTabFunc(docContextPath[0], options.openLocation ?? OpenWhere.addRight); this.AddViewRenderedCb(docContextPath[0], dv => res(dv)); })); if (options.openLocation?.includes(OpenWhere.lightbox)) { |