aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/PDFBox.tsx
diff options
context:
space:
mode:
authoryipstanley <stanley_yip@brown.edu>2019-06-20 12:37:28 -0400
committeryipstanley <stanley_yip@brown.edu>2019-06-20 12:37:28 -0400
commitaea1f5d804efd5bd38d72caf17d275304c3f7962 (patch)
treee97e350d2846f23435e9ba22e84054823981a919 /src/client/views/nodes/PDFBox.tsx
parent135e252902a3ca93e95672602122afb3be6cd015 (diff)
asdjfkl
Diffstat (limited to 'src/client/views/nodes/PDFBox.tsx')
-rw-r--r--src/client/views/nodes/PDFBox.tsx20
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() {