aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-09-13 13:58:07 -0400
committerbobzel <zzzman@gmail.com>2021-09-13 13:58:07 -0400
commit527b5a9dcd61f898c222eac0f2d5569bcfa35f5e (patch)
tree373ca6eea64debb5787972325841cf399e854f45 /src/client/util/DocumentManager.ts
parentce7e33562775b4cd4671dadd2d2fa9d448bc0290 (diff)
parente4c35687663dc61f03493dc3109b5dcbd6795a4b (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
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