aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 51f5fbe9f..c6962ad8d 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -110,7 +110,8 @@ export class DocumentManager {
}
@undoBatch
- public jumpToDocument = async (doc: Doc): Promise<void> => {
+ public jumpToDocument = async (docDelegate: Doc, makeCopy: boolean = true): Promise<void> => {
+ let doc = docDelegate.proto ? docDelegate.proto : docDelegate;
const page = NumCast(doc.page, undefined);
const contextDoc = await Cast(doc.annotationOn, Doc);
if (contextDoc) {
@@ -122,7 +123,7 @@ export class DocumentManager {
docView.props.focus(docView.props.Document);
} else {
if (!contextDoc) {
- CollectionDockingView.Instance.AddRightSplit(Doc.MakeDelegate(doc));
+ CollectionDockingView.Instance.AddRightSplit(docDelegate ? (makeCopy ? Doc.MakeCopy(docDelegate) : docDelegate) : Doc.MakeDelegate(doc));
} else {
let contextView = DocumentManager.Instance.getDocumentView(contextDoc);
if (contextView) {