aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/TabDocView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-28 09:19:40 -0400
committerbobzel <zzzman@gmail.com>2020-10-28 09:19:40 -0400
commit803ed1bdfd6d234245ab2663c6cd19fa386143b7 (patch)
tree789a3d19161918a34c5c978f9fa85440f7c6ce39 /src/client/views/collections/TabDocView.tsx
parent09dae896673d08d7030b71fb2c3f52924726f58e (diff)
parent7dc149a7ea8b988ba90f0a46466499ea46580e2e (diff)
Merge branch 'presentation_v1'
Diffstat (limited to 'src/client/views/collections/TabDocView.tsx')
-rw-r--r--src/client/views/collections/TabDocView.tsx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/views/collections/TabDocView.tsx b/src/client/views/collections/TabDocView.tsx
index dcd94a7e6..82530c26d 100644
--- a/src/client/views/collections/TabDocView.tsx
+++ b/src/client/views/collections/TabDocView.tsx
@@ -134,7 +134,10 @@ export class TabDocView extends React.Component<TabDocViewProps> {
pinDoc.title = doc.title + " - Slide";
pinDoc.presMovement = PresMovement.Zoom;
pinDoc.context = curPres;
- Doc.AddDocToList(curPres, "data", pinDoc);
+ const presArray: Doc[] = PresBox.Instance?.sortArray();
+ const size: number = PresBox.Instance?._selectedArray.size;
+ const presSelected: Doc | undefined = presArray && size ? presArray[size - 1] : undefined;
+ Doc.AddDocToList(curPres, "data", pinDoc, presSelected);
if (pinDoc.type === "audio" && !audioRange) {
pinDoc.presStartTime = 0;
pinDoc.presEndTime = doc.duration;
@@ -149,6 +152,8 @@ export class TabDocView extends React.Component<TabDocViewProps> {
tabdocs?.push(curPres); // bcz: Argh! this is annoying. if multiple documents are pinned, this will get called multiple times before the presentation view is drawn. Thus it won't be in the tabdocs list and it will get created multple times. so need to explicilty add the presbox to the list of open tabs
CollectionDockingView.AddSplit(curPres, "right");
}
+ PresBox.Instance?._selectedArray.clear();
+ pinDoc && PresBox.Instance?._selectedArray.set(pinDoc, undefined); //Update selected array
DocumentManager.Instance.jumpToDocument(doc, false, undefined);
batch.end();
}