aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionDockingView.tsx8
-rw-r--r--src/client/views/collections/CollectionMenu.tsx2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 39a52fb6d..d2c065417 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -108,6 +108,7 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
}
@undoBatch
+ @action
public static ReplaceTab(document: Doc, panelName: string, stack: any, addToSplit?: boolean): boolean {
const instance = CollectionDockingView.Instance;
if (!instance) return false;
@@ -140,8 +141,15 @@ export class CollectionDockingView extends CollectionSubView(doc => doc) {
// Creates a split on any side of the docking view based on the passed input pullSide and then adds the Document to the requested side
//
@undoBatch
+ @action
public static AddSplit(document: Doc, pullSide: string, stack?: any, panelName?: string) {
if (document._viewType === CollectionViewType.Docking) return CurrentUserUtils.openDashboard(Doc.UserDoc(), document);
+
+ const tab = Array.from(CollectionDockingView.Instance.tabMap).find(tab => tab.DashDoc === document);
+ if (tab) {
+ tab.header.parent.setActiveContentItem(tab.contentItem);
+ return true;
+ }
const instance = CollectionDockingView.Instance;
if (!instance) return false;
const docContentConfig = CollectionDockingView.makeDocumentConfig(document, panelName);
diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx
index abad23e0d..34a1c0697 100644
--- a/src/client/views/collections/CollectionMenu.tsx
+++ b/src/client/views/collections/CollectionMenu.tsx
@@ -400,7 +400,7 @@ export class CollectionViewBaseChrome extends React.Component<CollectionMenuProp
pinWithView = (targetDoc: Opt<Doc>) => {
if (targetDoc) {
TabDocView.PinDoc(targetDoc, false);
- const activeDoc = PresBox.Instance.childDocs[PresBox.Instance.childDocs.length - 1];
+ const activeDoc = PresBox.Instance?.childDocs[PresBox.Instance?.childDocs.length - 1];
if (targetDoc.type === DocumentType.PDF || targetDoc.type === DocumentType.RTF || targetDoc.type === DocumentType.WEB || targetDoc._viewType === CollectionViewType.Stacking) {
const scroll = targetDoc._scrollTop;
activeDoc.presPinView = true;