1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 04:50:09 +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:
Daniel Bonniot 2013-07-03 11:34:28 +02:00
parent d9bd8106fe
commit 4bde91423d

View File

@ -331,20 +331,37 @@ var pdf2htmlEX = (function(){
$(window).on('keydown', function keydown(e) {
switch (e.keyCode) {
case 33: // Page Down
_.scroll_to_page(_.get_prev_page());
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
_.scroll_to_page(_.get_next_page());
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]);