forked from Public/pics
PhotosIndex: fix arrow-key based navigation
This commit is contained in:
parent
b2bcb6a124
commit
af0c8990a6
@ -1,14 +1,14 @@
|
||||
function enableKeyDownNavigation() {
|
||||
document.addEventListener("keydown", function (event) {
|
||||
if (event.keyCode == 37) {
|
||||
var target = document.querySelector(".pagination ul > :first-child a");
|
||||
var target = document.querySelector("ul.pagination > :first-child a");
|
||||
if (target && target.href) {
|
||||
event.preventDefault();
|
||||
document.location.href = target.href;
|
||||
}
|
||||
}
|
||||
else if (event.keyCode == 39) {
|
||||
var target = document.querySelector(".pagination ul > :last-child a");
|
||||
var target = document.querySelector("ul.pagination > :last-child a");
|
||||
if (target && target.href) {
|
||||
event.preventDefault();
|
||||
document.location.href = target.href;
|
||||
|
Loading…
Reference in New Issue
Block a user