From 3213c24210d67af0a4b027863773ad383404a59c Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 9 Jun 2022 11:07:34 -0400
Subject: renamed fitToBox to fitContentsToBox.  fixed pinning multiple
 documents at same time to not bring up presBox multiple times.

---
 .../collections/collectionMulticolumn/CollectionMulticolumnView.tsx     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx')

diff --git a/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx b/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
index e2dfb25e2..7147ae485 100644
--- a/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
+++ b/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
@@ -257,7 +257,7 @@ export class CollectionMulticolumnView extends CollectionSubView() {
             isDocumentActive={this.props.childDocumentsActive?.() ? this.props.isDocumentActive : this.isContentActive}
             hideResizeHandles={this.props.childHideResizeHandles?.()}
             hideDecorationTitle={this.props.childHideDecorationTitle?.()}
-            fitContentsToDoc={this.props.fitContentsToDoc}
+            fitContentsToBox={this.props.fitContentsToBox}
             PanelWidth={width}
             PanelHeight={height}
             rootSelected={this.rootSelected}
-- 
cgit v1.2.3-70-g09d2


From 331cb0bec8089c4435126542ed3181fe227eff51 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 9 Jun 2022 11:53:33 -0400
Subject: fixes to navigating to slide document targets in header bar

---
 src/client/views/MainView.tsx                                 |  1 +
 .../collectionMulticolumn/CollectionMulticolumnView.tsx       |  1 +
 .../collectionMulticolumn/CollectionMultirowView.tsx          |  1 +
 src/client/views/nodes/trails/PresBox.tsx                     | 11 ++++++++---
 4 files changed, 11 insertions(+), 3 deletions(-)

(limited to 'src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx')

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index adcfd82dc..9516ea017 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -292,6 +292,7 @@ export class MainView extends React.Component {
                 isContentActive={returnTrue} // headerBar is awlays contentActive which means its items are always documentActive
                 ScreenToLocalTransform={this.headerBarScreenXf}
                 childHideResizeHandles={returnTrue}
+                dontRegisterView={true}
                 hideResizeHandles={true}
                 PanelWidth={this.headerBarDocWidth}
                 PanelHeight={this.headerBarDocHeight}
diff --git a/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx b/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
index 7147ae485..b7ba94940 100644
--- a/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
+++ b/src/client/views/collections/collectionMulticolumn/CollectionMulticolumnView.tsx
@@ -272,6 +272,7 @@ export class CollectionMulticolumnView extends CollectionSubView() {
             searchFilterDocs={this.searchFilterDocs}
             ContainingCollectionDoc={this.props.CollectionView?.props.Document}
             ContainingCollectionView={this.props.CollectionView}
+            dontRegisterView={this.props.dontRegisterView}
             addDocument={this.props.addDocument}
             moveDocument={this.props.moveDocument}
             removeDocument={this.props.removeDocument}
diff --git a/src/client/views/collections/collectionMulticolumn/CollectionMultirowView.tsx b/src/client/views/collections/collectionMulticolumn/CollectionMultirowView.tsx
index 3bda56c33..338639a83 100644
--- a/src/client/views/collections/collectionMulticolumn/CollectionMultirowView.tsx
+++ b/src/client/views/collections/collectionMulticolumn/CollectionMultirowView.tsx
@@ -271,6 +271,7 @@ export class CollectionMultirowView extends CollectionSubView() {
             searchFilterDocs={this.searchFilterDocs}
             ContainingCollectionDoc={this.props.CollectionView?.props.Document}
             ContainingCollectionView={this.props.CollectionView}
+            dontRegisterView={this.props.dontRegisterView}
             addDocument={this.props.addDocument}
             moveDocument={this.props.moveDocument}
             removeDocument={this.props.removeDocument}
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
-- 
cgit v1.2.3-70-g09d2

