From 42865450ea252e340d89a1f67c8a2dc0b9c6eae3 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 11 Feb 2021 02:38:23 -0500 Subject: more tweaking to simplify link following mechanisms. --- .../collectionFreeForm/CollectionFreeFormView.tsx | 29 ++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/client/views/collections') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 6fdd569da..7ae4137d9 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -913,27 +913,30 @@ export class CollectionFreeFormView extends CollectionSubView { + + // focus the collection in its parent view. the parent view after focusing determines whether to reset the view change within the collection + this.props.focus(this.rootDoc, willZoom, scale, (didFocus: boolean) => { setTimeout(() => { - if (afterFocus?.(didFocus || (px !== savedState.px || py !== savedState.py))) { + if (afterFocus?.(didFocus || didMove)) { + doc.hidden && Doc.UnHighlightDoc(doc); this.Document._panX = savedState.px; this.Document._panY = savedState.py; this.Document[this.scaleFieldKey] = savedState.s; this.Document._viewTransition = savedState.pt; + } else { + doc.hidden && Doc.UnHighlightDoc(doc); } - doc.hidden && Doc.UnHighlightDoc(doc); - }, px !== savedState.px || py !== savedState.py ? 500 : 0); + }, focusSpeed); return false; - }); - } + }) + }; } setPanIntoView = (doc: Doc) => { -- cgit v1.2.3-70-g09d2