aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/trails
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-09 11:53:33 -0400
committerbobzel <zzzman@gmail.com>2022-06-09 11:53:33 -0400
commit331cb0bec8089c4435126542ed3181fe227eff51 (patch)
tree238b6adda121636b8a75cee3b703eee4740c334f /src/client/views/nodes/trails
parent012a4681c824baaef60370de5904e9cc35b03f13 (diff)
fixes to navigating to slide document targets in header bar
Diffstat (limited to 'src/client/views/nodes/trails')
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index db2f58be7..da65e7919 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -333,11 +333,16 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
const bestTarget = DocumentManager.Instance.getFirstDocumentView(targetDoc)?.props.Document;
if (bestTarget) console.log(bestTarget.title, bestTarget.type);
else console.log("no best target");
- if (bestTarget) this._navTimer = PresBox.navigateToDoc(bestTarget, activeItem);
+ if (bestTarget) this._navTimer = PresBox.navigateToDoc(bestTarget, activeItem, false);
}
@action
- static navigateToDoc(bestTarget:Doc, activeItem:Doc) {
+ static navigateToDoc(bestTarget:Doc, activeItem:Doc, jumpToDoc:boolean) {
+ if (jumpToDoc) {
+ const srcContext = Cast(bestTarget.context, Doc, null) ?? Cast(Cast(bestTarget.annotationOn, Doc, null)?.context, Doc, null);
+ const openInTab = (doc: Doc, finished?: () => void) => CollectionDockingView.AddSplit(doc, "right");
+ DocumentManager.Instance.jumpToDocument(bestTarget, true, openInTab, srcContext ? [srcContext]:[], undefined, undefined, undefined,undefined, undefined, true, NumCast(activeItem.presZoom)); // documents open in new tab instead of on right
+ }
if (bestTarget.type === DocumentType.PDF || bestTarget.type === DocumentType.WEB || bestTarget.type === DocumentType.RTF || bestTarget._viewType === CollectionViewType.Stacking) {
bestTarget._viewTransition = activeItem.presTransition ? `transform ${activeItem.presTransition}ms` : 'all 0.5s';
bestTarget._scrollTop = activeItem.presPinViewScroll;
@@ -2576,5 +2581,5 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
}
ScriptingGlobals.add(function navigateToDoc(bestTarget:Doc, activeItem:Doc) {
- PresBox.navigateToDoc(bestTarget, activeItem);
+ PresBox.navigateToDoc(bestTarget, activeItem, true);
}); \ No newline at end of file