mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 13:00:08 +00:00
Scroll pages with alt-page up/down, not page up/down. Implement screen scrolling for page up/down. Fix comment about which key is up (code was right, but comments were inverted :D)
This commit is contained in:
parent
d9bd8106fe
commit
4bde91423d
@ -331,20 +331,37 @@ var pdf2htmlEX = (function(){
|
||||
$(window).on('keydown', function keydown(e) {
|
||||
|
||||
switch (e.keyCode) {
|
||||
case 33: // Page Down
|
||||
case 33: // Page UP:
|
||||
// pageup -> scroll one screen up
|
||||
// alt-pageup -> scroll one page up
|
||||
if (e.altKey) {
|
||||
_.scroll_to_page(_.get_prev_page());
|
||||
}
|
||||
else {
|
||||
_.$container.scrollTop(_.$container.scrollTop()-_.$container.height());
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
case 34: // Page Up
|
||||
|
||||
case 34: // Page DOWN
|
||||
// pagedown -> scroll one screen down
|
||||
// alt-pagedown -> scroll one page down
|
||||
if (e.altKey) {
|
||||
_.scroll_to_page(_.get_next_page());
|
||||
}
|
||||
else {
|
||||
_.$container.scrollTop(_.$container.scrollTop()+_.$container.height());
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case 35: // End
|
||||
if (e.ctrlKey) {
|
||||
_.scroll_to_page(_.pages[_.pages.length-1]);
|
||||
e.preventDefault();
|
||||
}
|
||||
break;
|
||||
|
||||
case 36: // Home
|
||||
if (e.ctrlKey) {
|
||||
_.scroll_to_page(_.pages[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user