mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
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:
parent
e698664927
commit
ea1ec7ffab
1 changed files with 2 additions and 6 deletions
|
@ -2487,14 +2487,10 @@ function webViewerDownload() {
|
|||
PDFViewerApplication.downloadOrSave();
|
||||
}
|
||||
function webViewerFirstPage() {
|
||||
if (PDFViewerApplication.pdfDocument) {
|
||||
PDFViewerApplication.page = 1;
|
||||
}
|
||||
PDFViewerApplication.page = 1;
|
||||
}
|
||||
function webViewerLastPage() {
|
||||
if (PDFViewerApplication.pdfDocument) {
|
||||
PDFViewerApplication.page = PDFViewerApplication.pagesCount;
|
||||
}
|
||||
PDFViewerApplication.page = PDFViewerApplication.pagesCount;
|
||||
}
|
||||
function webViewerNextPage() {
|
||||
PDFViewerApplication.pdfViewer.nextPage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue