From 45fe76e752dc6042f0f6e3df346ccb8deaf3c36b Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Tue, 2 Oct 2012 15:59:57 -0700 Subject: [PATCH] Add support for enter/shift for find. --- web/viewer.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/viewer.js b/web/viewer.js index 467f9515d..7933e5393 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -480,9 +480,17 @@ var PDFFindBar = { self.dispatchEvent(''); }); - // TODO: Add keybindings like enter, shift-enter, CMD-G etc. to go to prev/ + // TODO: Add keybindings CMD-G etc. to go to prev/ // next match when the findField is selected. + this.findField.addEventListener('keydown', function(evt) { + switch (evt.keyCode) { + case 13: // Enter + self.dispatchEvent('again', evt.shiftKey); + break; + } + }); + document.getElementById('findPrevious').addEventListener('click', function() { self.dispatchEvent('again', true); } );