Skip to content

Commit

Permalink
https://github.com/coolwanglu/pdf2htmlEX/issues/180
Browse files Browse the repository at this point in the history
Call e.preventDefault() when the key was handled.
  • Loading branch information
Daniel Bonniot committed Jul 3, 2013
1 parent 40dc097 commit d9bd810
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions share/pdf2htmlEX.js.in
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,23 @@ var pdf2htmlEX = (function(){
switch (e.keyCode) {
case 33: // Page Down
_.scroll_to_page(_.get_prev_page());
e.preventDefault();
break;
case 34: // Page Up
_.scroll_to_page(_.get_next_page());
e.preventDefault();
break;
case 35: // End
if (e.ctrlKey)
if (e.ctrlKey) {
_.scroll_to_page(_.pages[_.pages.length-1]);
e.preventDefault();
}
break;
case 36: // Home
if (e.ctrlKey)
if (e.ctrlKey) {
_.scroll_to_page(_.pages[1]);
e.preventDefault();
}
break;
}
});
Expand Down

0 comments on commit d9bd810

Please sign in to comment.