From 80f039a6568973b9b7348de2df59dee68f2228ea Mon Sep 17 00:00:00 2001 From: bobzel Date: Sun, 23 Aug 2020 10:25:32 -0400 Subject: added curPage to propertiesView. cleaned up curPage code in PDFBox/viewer. fixed warnings --- src/client/views/nodes/PDFBox.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 890263a61..621a7f672 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -99,9 +99,9 @@ export class PDFBox extends ViewBoxAnnotatableComponent { this._pdfViewer?.search(string, fwd); }; public prevAnnotation = () => { this._pdfViewer?.prevAnnotation(); }; public nextAnnotation = () => { this._pdfViewer?.nextAnnotation(); }; - public backPage = () => { this._pdfViewer!.gotoPage((this.Document.curPage || 1) - 1); }; - public forwardPage = () => { this._pdfViewer!.gotoPage((this.Document.curPage || 1) + 1); }; - public gotoPage = (p: number) => { this._pdfViewer!.gotoPage(p); }; + public backPage = () => { this.Document.curPage = (this.Document.curPage || 1) - 1; }; + public forwardPage = () => { this.Document.curPage = (this.Document.curPage || 1) + 1; }; + public gotoPage = (p: number) => { this.Document.curPage = p; }; @undoBatch onKeyDown = action((e: KeyboardEvent) => { @@ -177,7 +177,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent this.gotoPage(Number(e.currentTarget.value))} + onChange={e => this.Document.curPage = Number(e.currentTarget.value)} style={{ width: `${curPage > 99 ? 4 : 3}ch`, pointerEvents: "all" }} onClick={action(() => this._pageControls = !this._pageControls)} /> {this._pageControls ? pageBtns : (null)} -- cgit v1.2.3-70-g09d2