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
@ -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…
x
Reference in New Issue
Block a user