aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/util/DocumentManager.ts3
-rw-r--r--src/new_fields/Doc.ts2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index a5e768dcf..94d77f467 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -116,13 +116,14 @@ export class DocumentManager {
@undoBatch
public jumpToDocument = async (docDelegate: Doc, makeCopy: boolean = true, dockFunc?: (doc: Doc) => void): Promise<void> => {
- let doc = docDelegate.proto ? docDelegate.proto : docDelegate;
+ let doc = Doc.GetProto(docDelegate);
const page = NumCast(doc.page, undefined);
const contextDoc = await Cast(doc.annotationOn, Doc);
if (contextDoc) {
const curPage = NumCast(contextDoc.curPage, page);
if (page !== curPage) contextDoc.curPage = page;
}
+ docDelegate.libraryBrush = true;
let docView = DocumentManager.Instance.getDocumentView(doc);
if (docView) {
docView.props.focus(docView.props.Document);
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index b0237d04d..793a83750 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -194,7 +194,7 @@ export namespace Doc {
// gets the document's prototype or returns the document if it is a prototype
export function GetProto(doc: Doc) {
- return Object.getOwnPropertyNames(doc).indexOf("isPrototype") === -1 ? doc.proto! : doc;
+ return Doc.GetT(doc, "isPrototype", "boolean", true) ? doc : doc.proto!;
}