diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-06-20 12:37:28 -0400 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-06-20 12:37:28 -0400 |
| commit | aea1f5d804efd5bd38d72caf17d275304c3f7962 (patch) | |
| tree | e97e350d2846f23435e9ba22e84054823981a919 /src/client/views/nodes/PDFBox.tsx | |
| parent | 135e252902a3ca93e95672602122afb3be6cd015 (diff) | |
asdjfkl
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
| -rw-r--r-- | src/client/views/nodes/PDFBox.tsx | 20 |
1 files changed, 18 insertions, 2 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() { |
