1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-03 08:38:39 +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:
Daniel Bonniot 2013-07-03 22:02:53 +02:00
parent 4bde91423d
commit 972c92540e

View File

@ -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();
});
},