From c4a8b656eff910fb6c2cd1693308f0b948547cb0 Mon Sep 17 00:00:00 2001
From: Mohammad Amoush <mohammad_amoush@brown.edu>
Date: Mon, 29 Jul 2019 20:43:18 -0400
Subject: Opening as a tab if not present as default instead of open right

---
 src/client/views/presentationview/PresentationView.tsx | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

(limited to 'src/client/views/presentationview/PresentationView.tsx')

diff --git a/src/client/views/presentationview/PresentationView.tsx b/src/client/views/presentationview/PresentationView.tsx
index c583ae4ce..ea85a8c6a 100644
--- a/src/client/views/presentationview/PresentationView.tsx
+++ b/src/client/views/presentationview/PresentationView.tsx
@@ -33,7 +33,6 @@ library.add(faEye);
 
 export interface PresViewProps {
     Documents: List<Doc>;
-    addDocTab: (doc: Doc) => void;
 }
 
 const expandedWidth = 400;
@@ -369,11 +368,6 @@ export class PresentationView extends React.Component<PresViewProps>  {
             //checking if curDoc has navigation open
             let curDocButtons = this.presElementsMappings.get(curDoc)!.selected;
             if (curDocButtons[buttonIndex.Navigate]) {
-                // if (curDocButtons[buttonIndex.OpenRight]) {
-                //     DocumentManager.Instance.jumpToDocument(curDoc, false);
-                // } else {
-                //     DocumentManager.Instance.jumpToDocument(curDoc, false, undefined, this.props.addDocTab);
-                // }
                 this.jumpToTabOrRight(curDocButtons, curDoc);
             } else if (curDocButtons[buttonIndex.Show]) {
                 let curScale = DocumentManager.Instance.getScaleOfDocView(this.childrenDocs[fromDoc]);
@@ -381,7 +375,7 @@ export class PresentationView extends React.Component<PresViewProps>  {
                     //awaiting jump so that new scale can be found, since jumping is async
                     await DocumentManager.Instance.jumpToDocument(curDoc, true);
                 } else {
-                    await DocumentManager.Instance.jumpToDocument(curDoc, false, undefined, this.props.addDocTab);
+                    await DocumentManager.Instance.jumpToDocument(curDoc, false, undefined, doc => CollectionDockingView.Instance.AddTab(undefined, doc, undefined));
                 }
 
                 let newScale = DocumentManager.Instance.getScaleOfDocView(curDoc);
@@ -403,7 +397,7 @@ export class PresentationView extends React.Component<PresViewProps>  {
             //awaiting jump so that new scale can be found, since jumping is async
             await DocumentManager.Instance.jumpToDocument(docToJump, willZoom);
         } else {
-            await DocumentManager.Instance.jumpToDocument(docToJump, willZoom, undefined, this.props.addDocTab);
+            await DocumentManager.Instance.jumpToDocument(docToJump, willZoom, undefined, doc => CollectionDockingView.Instance.AddTab(undefined, doc, undefined));
         }
         let newScale = DocumentManager.Instance.getScaleOfDocView(curDoc);
         curDoc.viewScale = newScale;
@@ -418,9 +412,7 @@ export class PresentationView extends React.Component<PresViewProps>  {
         if (curDocButtons[buttonIndex.OpenRight]) {
             DocumentManager.Instance.jumpToDocument(curDoc, false);
         } else {
-            console.log("Open in tab!!");
-            // DocumentManager.Instance.jumpToDocument(curDoc, false, undefined, this.props.addDocTab);
-            CollectionDockingView.Instance.AddTab(undefined, curDoc, undefined);
+            DocumentManager.Instance.jumpToDocument(curDoc, false, undefined, doc => CollectionDockingView.Instance.AddTab(undefined, doc, undefined));
         }
     }
 
-- 
cgit v1.2.3-70-g09d2

