From 83aaea5320257ce15d68a5299c00977684ddab8e Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 6 Oct 2020 11:07:28 -0400 Subject: restored ability to open document that has been moved from another document's annotation overlay --- src/client/util/DocumentManager.ts | 8 +++++--- .../collections/collectionFreeForm/CollectionFreeFormView.tsx | 3 ++- src/client/views/nodes/FieldView.tsx | 2 +- src/client/views/pdf/PDFViewer.tsx | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts index 2ca29cb7e..e2518d05f 100644 --- a/src/client/util/DocumentManager.ts +++ b/src/client/util/DocumentManager.ts @@ -193,11 +193,13 @@ export class DocumentManager { if (retryDocView) { // we found the target in the context retryDocView.props.focus(targetDoc, willZoom, undefined, focusAndFinish); // focus on the target in the context highlight(); - } - if (delay > 2500) { + } else if (delay > 1500) { // we didn't find the target, so it must have moved out of the context. Go back to just creating it. if (closeContextIfNotFound) targetDocContextView.props.removeDocument?.(targetDocContextView.props.Document); - // targetDoc.layout && createViewFunc(Doc.BrushDoc(targetDoc), finished); // create a new view of the target + if (targetDoc.layout) { + Doc.SetInPlace(targetDoc, "annotationOn", undefined, false); + createViewFunc(Doc.BrushDoc(targetDoc), finished); // create a new view of the target + } } else { setTimeout(() => findView(delay + 250), 250); } diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 2783011cf..fc3fd3a7c 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -891,9 +891,10 @@ export class CollectionFreeFormView extends CollectionSubView { // ); } else if (field instanceof List) { - return
{field.length ? field.map(f => Field.toString(f)).join(", ") : "[]"}
; + return
{field.length ? field.map(f => Field.toString(f)).join(", ") : ""}
; } // bcz: this belongs here, but it doesn't render well so taking it out for now else if (field instanceof WebField) { diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 582e4ba84..4c5f72b97 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -180,9 +180,9 @@ export class PDFViewer extends ViewBoxAnnotatableComponent this._mainCont.current && smoothScroll(1000, this._mainCont.current, scrollY || 0), 250); } setTimeout(() => this.Document._scrollY = undefined, 1000); } -- cgit v1.2.3-70-g09d2