From aea1f5d804efd5bd38d72caf17d275304c3f7962 Mon Sep 17 00:00:00 2001 From: yipstanley Date: Thu, 20 Jun 2019 12:37:28 -0400 Subject: asdjfkl --- src/client/views/nodes/PDFBox.tsx | 20 ++++++++++++++++++-- src/client/views/pdf/PDFViewer.tsx | 1 - 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 0aeb9afc8..8daea2541 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -38,13 +38,29 @@ export class PDFBox extends DocComponent(PdfDocumen () => this.props.Document.scrollY, () => { if (this._mainCont.current) { - this._mainCont.current && this._mainCont.current.scrollTo({ top: NumCast(this.Document.scrollY), behavior: "smooth" }); + this._mainCont.current && this._mainCont.current.scrollTo({ top: NumCast(this.Document.scrollY), behavior: "auto" }); } - }); + } + ); } + @action componentDidMount() { if (this.props.setPdfBox) this.props.setPdfBox(this); + + this._scrollY = NumCast(this.Document.startY); + this.props.Document.scrollY = this.Document.startY; + // let ccv = this.props.ContainingCollectionView; + // if (ccv) { + // ccv.props.Document.scrollY = this.Document.startY; + // } + } + + componentWillUnmount() { + let ccv = this.props.ContainingCollectionView; + if (ccv) { + ccv.props.Document.scrollY = this.Document.startY; + } } public GetPage() { diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 015d8f878..bb549a743 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -128,7 +128,6 @@ class Viewer extends React.Component { let startY = NumCast(this.props.parent.Document.startY); this.props.parent.Document.scrollY = startY; - console.log(startY); // this.props.loaded(Math.max(...pageSizes.map(i => i.width)), pageSizes[0].height, this.props.pdf.numPages); } } -- cgit v1.2.3-70-g09d2