add ability to go to prev post

master
Aevann 2024-04-07 06:28:41 +02:00
parent 621b7d5fa0
commit 084b9cdcbb
1 changed files with 4 additions and 2 deletions

View File

@ -21,12 +21,14 @@ if (post_permalinks) {
document.addEventListener('keydown', (e) => {
if (
["d", "ArrowRight"].includes(e.key) &&
!["TEXTAREA", "INPUT"].includes(document.activeElement.tagName) &&
!(e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) &&
!expandImageModal.classList.contains('show')
) {
location.href = permalink_after.slice(1, -1)
if (["ArrowRight", "d"].includes(e.key))
location.href = permalink_after.slice(1, -1)
if (["ArrowLeft", "a"].includes(e.key))
history.back()
}
})
}