mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Add support for enter/shift for find.
This commit is contained in:
parent
3bd20a7415
commit
45fe76e752
1 changed files with 9 additions and 1 deletions
|
@ -480,9 +480,17 @@ var PDFFindBar = {
|
||||||
self.dispatchEvent('');
|
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.
|
// 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',
|
document.getElementById('findPrevious').addEventListener('click',
|
||||||
function() { self.dispatchEvent('again', true); }
|
function() { self.dispatchEvent('again', true); }
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue