mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Prevent rendering unnecessary pages when the HOME/END keys are pressed
Currently (at least in Firefox) when the HOME/END keys are pressed, this will trigger unnecessary rendering of pages that lay between the current page and the first/last page. Avoid this by going straight to the first/last page instead.
This commit is contained in:
parent
834c69aa0a
commit
5ac4dd9593
1 changed files with 3 additions and 2 deletions
|
@ -2347,13 +2347,14 @@ window.addEventListener('keydown', function keydown(evt) {
|
|||
break;
|
||||
|
||||
case 36: // home
|
||||
if (PresentationMode.active) {
|
||||
if (PresentationMode.active || PDFView.page > 1) {
|
||||
PDFView.page = 1;
|
||||
handled = true;
|
||||
}
|
||||
break;
|
||||
case 35: // end
|
||||
if (PresentationMode.active) {
|
||||
if (PresentationMode.active ||
|
||||
PDFView.page < PDFView.pdfDocument.numPages) {
|
||||
PDFView.page = PDFView.pdfDocument.numPages;
|
||||
handled = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue