From 8538a83baf57d7015b62b4ebc22d2bd7318f9d16 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 19 Jan 2021 15:02:03 -0500
Subject: fixed isPushpin annotation behavior outside of PDFs.  fixed link
 follow highlighting to go away when target is hidden.

---
 .../views/collections/collectionFreeForm/CollectionFreeFormView.tsx  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index f934fcd92..588ba6922 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -945,17 +945,18 @@ export class CollectionFreeFormView extends CollectionSubView<PanZoomDocument, P
             const newAfterFocus = (didFocus: boolean) => {
                 afterFocus && setTimeout(() => {
                     // @ts-ignore
-                    if (afterFocus?.(didFocus || (newPanX !== savedState.px || newPanY !== savedState.py))) {
+                    if (afterFocus?.(!dontCenter && (didFocus || (newPanX !== savedState.px || newPanY !== savedState.py)))) {
                         this.Document._panX = savedState.px;
                         this.Document._panY = savedState.py;
                         this.Document[this.scaleFieldKey] = savedState.s;
                         this.Document._viewTransition = savedState.pt;
                     }
+                    doc.hidden && Doc.UnHighlightDoc(doc);
                 }, newPanX !== savedState.px || newPanY !== savedState.py ? 500 : 0);
                 return false;
             };
             this.props.focus(this.props.Document, undefined, undefined, newAfterFocus, undefined, newDidFocus);
-            Doc.linkFollowHighlight(doc);
+            !doc.hidden && Doc.linkFollowHighlight(doc);
         }
 
     }
-- 
cgit v1.2.3-70-g09d2

