diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 20 | ||||
-rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 1 |
2 files changed, 18 insertions, 3 deletions
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<FieldViewProps, PdfDocument>(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<IViewerProps> { 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); } } |