Aevann 2024-01-15 04:08:30 +02:00
parent 7619239df6
commit 03bfb79ca4
1 changed files with 7 additions and 5 deletions

View File

@ -52,11 +52,13 @@ if (current_index > -1) {
const id_before = post_ids[current_index-1]
document.addEventListener('keydown', (e) => {
if (id_before && e.key == 'ArrowLeft') {
location.href = id_before.slice(1, -1)
}
else if (id_after && e.key == 'ArrowRight') {
location.href = id_after.slice(1, -1)
if (document.activeElement.tagName != 'TEXTAREA') {
if (id_before && e.key == 'ArrowLeft') {
location.href = id_before.slice(1, -1)
}
else if (id_after && e.key == 'ArrowRight') {
location.href = id_after.slice(1, -1)
}
}
})