Add support for enter/shift for find.

This commit is contained in:
Brendan Dahl 2012-10-02 15:59:57 -07:00
parent 3bd20a7415
commit 45fe76e752

View File

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