Ensure that the viewer always receives focus when the HOME/END keys are pressed (bug 1186842)

It appears that I broke this with PR 4941.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1186842.
This commit is contained in:
Jonas Jenwald 2015-07-23 12:04:49 +02:00
parent 862342189f
commit d5232f5b5a

View File

@ -1993,6 +1993,9 @@ window.addEventListener('keydown', function keydown(evt) {
if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {
PDFViewerApplication.page = 1;
handled = true;
if (!pdfViewer.containsElement(curElement)) {
pdfViewer.focus();
}
}
break;
case 35: // end
@ -2000,6 +2003,9 @@ window.addEventListener('keydown', function keydown(evt) {
PDFViewerApplication.page < PDFViewerApplication.pagesCount)) {
PDFViewerApplication.page = PDFViewerApplication.pagesCount;
handled = true;
if (!pdfViewer.containsElement(curElement)) {
pdfViewer.focus();
}
}
break;