aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-01 13:14:30 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-01 13:14:30 -0500
commit92b5c8bc048190ac6c90a6fdf0f04b9f053f412f (patch)
tree95c95eed84fa4018e492f5ec8ad036bffc2772b3 /src/client/util/DocumentManager.ts
parent581ba904dc9bd02f6e2d81f42c45f38f6ad26cab (diff)
parentf38485f2778c9dbcc4dd663527c58ea450acb832 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into anika_linking
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index fb5d1717e..1fa5faeb3 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -146,7 +146,7 @@ export class DocumentManager {
};
const docView = getFirstDocView(targetDoc, originatingDoc);
let annotatedDoc = await Cast(targetDoc.annotationOn, Doc);
- if (annotatedDoc) {
+ if (annotatedDoc && !linkDoc?.isPushpin) {
const first = getFirstDocView(annotatedDoc);
if (first) {
annotatedDoc = first.props.Document;
@@ -156,7 +156,11 @@ export class DocumentManager {
}
}
if (docView) { // we have a docView already and aren't forced to create a new one ... just focus on the document. TODO move into view if necessary otherwise just highlight?
- docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish);
+ if (linkDoc?.isPushpin) docView.props.Document.hidden = !docView.props.Document.hidden;
+ else {
+ docView.props.Document.hidden && (docView.props.Document.hidden = undefined);
+ docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish);
+ }
highlight();
} else {
const contextDocs = docContext ? await DocListCastAsync(docContext.data) : undefined;