restore keyboard post navigation

master
Aevann 2024-04-06 09:50:04 +02:00
parent 80c0ed3959
commit 10e5e0c841
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,16 @@ if (post_permalinks) {
btn.classList.remove('d-none')
btn.href = permalink_after.slice(1, -1)
}
document.addEventListener('keydown', (e) => {
if (
["d", "ArrowRight"].includes(e.key) &&
!["TEXTAREA", "INPUT"].includes(document.activeElement.tagName) &&
!(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey)
) {
location.href = permalink_after.slice(1, -1)
}
})
}
}
}