[Pkg-javascript-commits] [pdf.js] 118/157: Ensure that the viewer always receives focus when the HOME/END keys are pressed (bug 1186842)

David Prévot taffit at moszumanska.debian.org
Tue Aug 11 06:46:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit d5232f5b5a24efb1fa90a3f41ebd68d513661d6b
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Jul 23 12:04:49 2015 +0200

    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.
---
 web/viewer.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/web/viewer.js b/web/viewer.js
index fc6e8f3..9bbe8d8 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -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;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list