mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +00:00
Use return in the non-handled key cases, and call preventDefault() in a single place, as suggested.
https://github.com/coolwanglu/pdf2htmlEX/issues/180
This commit is contained in:
parent
4bde91423d
commit
972c92540e
@ -340,7 +340,6 @@ var pdf2htmlEX = (function(){
|
||||
else {
|
||||
_.$container.scrollTop(_.$container.scrollTop()-_.$container.height());
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
||||
case 34: // Page DOWN
|
||||
@ -352,23 +351,28 @@ var pdf2htmlEX = (function(){
|
||||
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();
|
||||
}
|
||||
else
|
||||
return;
|
||||
break;
|
||||
|
||||
case 36: // Home
|
||||
if (e.ctrlKey) {
|
||||
_.scroll_to_page(_.pages[1]);
|
||||
e.preventDefault();
|
||||
}
|
||||
else
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
});
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user