aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-10-06 11:07:28 -0400
committerbobzel <zzzman@gmail.com>2020-10-06 11:07:28 -0400
commit83aaea5320257ce15d68a5299c00977684ddab8e (patch)
treecdb96cd3b4407684669c88c82e753173875d26e2 /src/client/views/pdf/PDFViewer.tsx
parent9c4701f8a8214544a0e1e6b31887d393e8ad344f (diff)
restored ability to open document that has been moved from another document's annotation overlay
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 3 insertions, 3 deletions
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<IViewerProps, PdfDocu
if (scrollY !== undefined) {
(this._showCover || this._showWaiting) && this.setupPdfJsViewer();
if ((this.props.renderDepth === -1 || (!LinkDocPreview.TargetDoc && !FormattedTextBoxComment.linkDoc)) && this._mainCont.current) {
- smoothScroll(1000, this._mainCont.current, (this.Document._scrollY || 0));
- } else {
- console.log("Waiting for preview");
+ smoothScroll(1000, this._mainCont.current, scrollY || 0);
+ } else if (!LinkDocPreview.TargetDoc && !FormattedTextBoxComment.linkDoc) { // wait for mainCont and try again to scroll
+ setTimeout(() => this._mainCont.current && smoothScroll(1000, this._mainCont.current, scrollY || 0), 250);
}
setTimeout(() => this.Document._scrollY = undefined, 1000);
}