aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-09-26 12:02:35 -0400
committerbob <bcz@cs.brown.edu>2019-09-26 12:02:35 -0400
commit0c0b5697957af3c1aa4560a707d37b1073b743a5 (patch)
tree6e3a70cb9dc0b86a47d49e17af44683b4cbd1cc5 /src/client/views/pdf/PDFViewer.tsx
parentc03b5dbf814bb6e6f7f2705a025e52f9a335de05 (diff)
more pdf cleanup/fixes
Diffstat (limited to 'src/client/views/pdf/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 848f1ddcd..427da1d9b 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -40,7 +40,6 @@ interface IViewerProps {
renderDepth: number;
isSelected: () => boolean;
loaded: (nw: number, nh: number, np: number) => void;
- scrollTo: (y: number) => void;
active: () => boolean;
GoToPage?: (n: number) => void;
addDocTab: (document: Doc, dataDoc: Doc | undefined, where: string) => boolean;
@@ -263,6 +262,11 @@ export class PDFViewer extends React.Component<IViewerProps> {
}
@action
+ gotoPage = (p: number) => {
+ this.pdfViewer.scrollPageIntoView({ pageNumber: Math.min(Math.max(1, p), this._pageSizes.length) });
+ }
+
+ @action
scrollToAnnotation = (scrollToAnnotation: Doc) => {
this.allAnnotations.forEach(d => Doc.UnBrushDoc(d));
let windowHgt = this.props.PanelHeight() / this.props.ContentScaling();