forked from wallabag/wallabag
use keydown instead of keypress for Chrome compatibility
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
function navigateKeyboard(leftURL, rightURL) {
|
function navigateKeyboard(leftURL, rightURL) {
|
||||||
window.addEventListener("keypress", function (event) {
|
window.addEventListener("keydown", function (event) {
|
||||||
var key = event.which || event.keyCode; // event.keyCode is used for IE8 and earlier versions
|
var key = event.which || event.keyCode; // event.keyCode is used for IE8 and earlier versions
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case 37:
|
case 37:
|
||||||
@ -24,4 +24,4 @@ function goRight(rightURL) {
|
|||||||
if (rightURL != "?view=view&id=") {
|
if (rightURL != "?view=view&id=") {
|
||||||
window.location = window.location.origin + window.location.pathname + rightURL;
|
window.location = window.location.origin + window.location.pathname + rightURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user