1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00
Call e.preventDefault() when the key was handled.
This commit is contained in:
Daniel Bonniot 2013-07-03 11:27:12 +02:00
parent 40dc097ebd
commit d9bd8106fe

View File

@ -333,17 +333,23 @@ var pdf2htmlEX = (function(){
switch (e.keyCode) { switch (e.keyCode) {
case 33: // Page Down case 33: // Page Down
_.scroll_to_page(_.get_prev_page()); _.scroll_to_page(_.get_prev_page());
e.preventDefault();
break; break;
case 34: // Page Up case 34: // Page Up
_.scroll_to_page(_.get_next_page()); _.scroll_to_page(_.get_next_page());
e.preventDefault();
break; break;
case 35: // End case 35: // End
if (e.ctrlKey) if (e.ctrlKey) {
_.scroll_to_page(_.pages[_.pages.length-1]); _.scroll_to_page(_.pages[_.pages.length-1]);
e.preventDefault();
}
break; break;
case 36: // Home case 36: // Home
if (e.ctrlKey) if (e.ctrlKey) {
_.scroll_to_page(_.pages[1]); _.scroll_to_page(_.pages[1]);
e.preventDefault();
}
break; break;
} }
}); });