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:
Jonas Jenwald 2014-06-14 14:11:42 +02:00
parent 834c69aa0a
commit 5ac4dd9593

View File

@ -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;
}