aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-06-09 12:08:27 -0400
committerbobzel <zzzman@gmail.com>2022-06-09 12:08:27 -0400
commit9fa00d5bf6f21081bfb9f7be8ead8ccb8574c2e7 (patch)
treef47dab433b0ee2a9044d72c07896cd6cb092b482
parent331cb0bec8089c4435126542ed3181fe227eff51 (diff)
fixed setting view specs of documents after navigating from headerBar slides
-rw-r--r--src/client/views/nodes/trails/PresBox.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/nodes/trails/PresBox.tsx b/src/client/views/nodes/trails/PresBox.tsx
index da65e7919..1dd6fef9b 100644
--- a/src/client/views/nodes/trails/PresBox.tsx
+++ b/src/client/views/nodes/trails/PresBox.tsx
@@ -336,13 +336,10 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
if (bestTarget) this._navTimer = PresBox.navigateToDoc(bestTarget, activeItem, false);
}
+ // navigates to the bestTarget document by making sure it is on screen,
+ // then it applies the view specs stored in activeItem to
@action
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;
@@ -2581,5 +2578,8 @@ export class PresBox extends ViewBoxBaseComponent<FieldViewProps>() {
}
ScriptingGlobals.add(function navigateToDoc(bestTarget:Doc, activeItem:Doc) {
- PresBox.navigateToDoc(bestTarget, activeItem, true);
+ 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"); finished?.(); };
+ DocumentManager.Instance.jumpToDocument(bestTarget, true, openInTab, srcContext ? [srcContext]:[],
+ undefined, undefined, undefined, () => PresBox.navigateToDoc(bestTarget, activeItem, true), undefined, true, NumCast(activeItem.presZoom));
}); \ No newline at end of file