aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorGeireann Lindfield Roberts <60007097+geireann@users.noreply.github.com>2021-09-13 13:52:15 -0400
committerGitHub <noreply@github.com>2021-09-13 13:52:15 -0400
commite4c35687663dc61f03493dc3109b5dcbd6795a4b (patch)
tree40702492d39e80bff9847eaffdd4f8a0151a9198 /src/client/util/DocumentManager.ts
parent8e5357cd2ebfaad88c82ffde2415426fa9d130c0 (diff)
parent6352c67a2eb361efad6a3dea81c9558d93bfc490 (diff)
Merge pull request #39 from brown-dash/menu_updates_geireann
Menu updates geireann
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 9e190ad02..dfec9823b 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -158,7 +158,8 @@ export class DocumentManager {
closeContextIfNotFound: boolean = false, // after opening a context where the document should be, this determines whether the context should be closed if the Doc isn't actually there
originatingDoc: Opt<Doc> = undefined, // doc that initiated the display of the target odoc
finished?: () => void,
- originalTarget?: Doc
+ originalTarget?: Doc,
+ noSelect?: boolean
): Promise<void> => {
originalTarget = originalTarget ?? targetDoc;
const getFirstDocView = LightboxView.LightboxDoc ? DocumentManager.Instance.getLightboxDocumentView : DocumentManager.Instance.getFirstDocumentView;
@@ -172,7 +173,7 @@ export class DocumentManager {
}
} else {
targetDoc.hidden && (targetDoc.hidden = undefined);
- docView?.select(false);
+ !noSelect && docView?.select(false);
}
finished?.();
return false;
@@ -189,7 +190,7 @@ export class DocumentManager {
annoContainerView.focus(targetDoc); // this allows something like a PDF view to remove its doc filters to expose the target so that it can be found in the retry code below
}
if (focusView) {
- Doc.linkFollowHighlight(focusView.rootDoc);
+ !noSelect && Doc.linkFollowHighlight(focusView.rootDoc); //TODO:glr make this a setting in PresBox
focusView.focus(targetDoc, {
originalTarget, willZoom, afterFocus: (didFocus: boolean) =>
new Promise<ViewAdjustment>(res => {
@@ -222,7 +223,7 @@ export class DocumentManager {
retryDocView.props.focus(targetDoc, {
willZoom, afterFocus: (didFocus: boolean) =>
new Promise<ViewAdjustment>(res => {
- focusAndFinish(didFocus);
+ !noSelect && focusAndFinish(didFocus);
res();
})
}); // focus on the target in the context