diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-06-22 16:10:06 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-06-22 16:10:25 +0200 |
commit | aade44471d3a603f90cb7750d829fff5efc9cad4 (patch) | |
tree | 78187502b76c995f05bb4d4332e9a7dc73717a55 | |
parent | 2d2366bb57ea677223d79e3e60d62fcd6c184471 (diff) | |
download | nextcloud-server-aade44471d3a603f90cb7750d829fff5efc9cad4.tar.gz nextcloud-server-aade44471d3a603f90cb7750d829fff5efc9cad4.zip |
pdf viewer no longer 'eats' keyboard input
-rw-r--r-- | apps/files_pdfviewer/js/pdfjs/viewer.js | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/apps/files_pdfviewer/js/pdfjs/viewer.js b/apps/files_pdfviewer/js/pdfjs/viewer.js index 8a568e6a749..f49257d7929 100644 --- a/apps/files_pdfviewer/js/pdfjs/viewer.js +++ b/apps/files_pdfviewer/js/pdfjs/viewer.js @@ -1871,70 +1871,4 @@ window.addEventListener('DOMMouseScroll', function(evt) { } }, false); -window.addEventListener('keydown', function keydown(evt) { - var handled = false; - var cmd = (evt.ctrlKey ? 1 : 0) | - (evt.altKey ? 2 : 0) | - (evt.shiftKey ? 4 : 0) | - (evt.metaKey ? 8 : 0); - - // First, handle the key bindings that are independent whether an input - // control is selected or not. - if (cmd == 1 || cmd == 8) { // either CTRL or META key. - switch (evt.keyCode) { - case 61: // FF/Mac '=' - case 107: // FF '+' and '=' - case 187: // Chrome '+' - PDFView.zoomIn(); - handled = true; - break; - case 109: // FF '-' - case 189: // Chrome '-' - PDFView.zoomOut(); - handled = true; - break; - case 48: // '0' - PDFView.parseScale(kDefaultScale, true); - handled = true; - break; - } - } - if (handled) { - evt.preventDefault(); - return; - } - - // Some shortcuts should not get handled if a control/input element - // is selected. - var curElement = document.activeElement; - if (curElement && curElement.tagName == 'INPUT') - return; - var controlsElement = document.getElementById('controls'); - while (curElement) { - if (curElement === controlsElement) - return; // ignoring if the 'controls' element is focused - curElement = curElement.parentNode; - } - - if (cmd == 0) { // no control key pressed at all. - switch (evt.keyCode) { - case 37: // left arrow - case 75: // 'k' - case 80: // 'p' - PDFView.page--; - handled = true; - break; - case 39: // right arrow - case 74: // 'j' - case 78: // 'n' - PDFView.page++; - handled = true; - break; - } - } - - if (handled) { - evt.preventDefault(); - } -}); |