Remove a couple of unnecessary pdfDocument checks in web/app.js

These functions invoke the `PDFViewer.currentPageNumber` setter, which already checks that a `pdfDocument` is currently active. Also, given that they're event handlers for the First/Last-page buttons (in the SecondaryToolbar) they can't be invoked before the viewer has been fully initalized.
This commit is contained in:
Jonas Jenwald 2023-02-04 22:17:53 +01:00
parent e698664927
commit ea1ec7ffab

View File

@ -2487,14 +2487,10 @@ function webViewerDownload() {
PDFViewerApplication.downloadOrSave(); PDFViewerApplication.downloadOrSave();
} }
function webViewerFirstPage() { function webViewerFirstPage() {
if (PDFViewerApplication.pdfDocument) { PDFViewerApplication.page = 1;
PDFViewerApplication.page = 1;
}
} }
function webViewerLastPage() { function webViewerLastPage() {
if (PDFViewerApplication.pdfDocument) { PDFViewerApplication.page = PDFViewerApplication.pagesCount;
PDFViewerApplication.page = PDFViewerApplication.pagesCount;
}
} }
function webViewerNextPage() { function webViewerNextPage() {
PDFViewerApplication.pdfViewer.nextPage(); PDFViewerApplication.pdfViewer.nextPage();