forked from MarseyWorld/MarseyWorld
improve post nav
parent
b020f8a300
commit
8d10bf224a
|
@ -14,9 +14,13 @@ if (post_permalinks) {
|
|||
pid = permalink_after.split('/').slice(-2, -1)[0]
|
||||
}
|
||||
|
||||
function go_next() {
|
||||
location.replace(permalink_after.slice(1, -1))
|
||||
}
|
||||
|
||||
for (const btn of document.getElementsByClassName('post_navigation')) {
|
||||
btn.classList.remove('d-none')
|
||||
btn.href = permalink_after.slice(1, -1)
|
||||
btn.onclick = go_next
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', (e) => {
|
||||
|
@ -26,9 +30,7 @@ if (post_permalinks) {
|
|||
!expandImageModal.classList.contains('show')
|
||||
) {
|
||||
if (["ArrowRight", "d"].includes(e.key))
|
||||
location.href = permalink_after.slice(1, -1)
|
||||
if (["ArrowLeft", "a"].includes(e.key))
|
||||
history.back()
|
||||
go_next()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -200,9 +200,9 @@
|
|||
{% endif %}
|
||||
|
||||
{% if p %}
|
||||
<a class="post_navigation d-none mobile-nav-icon d-md-none" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Next Post">
|
||||
<button class="post_navigation d-none mobile-nav-icon d-md-none" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Next Post">
|
||||
<i class="fas fa-arrow-right align-middle text-gray-500 black"></i>
|
||||
</a>
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
{% if g.browser == 'webview' %}
|
||||
|
@ -258,9 +258,9 @@
|
|||
|
||||
{% if p %}
|
||||
<li class="nav-item d-flex align-items-center text-center justify-content-center mx-1">
|
||||
<a class="post_navigation d-none nav-link" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Next Post">
|
||||
<button class="post_navigation d-none nav-link" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Next Post">
|
||||
<i class="fas fa-arrow-right"></i>
|
||||
</a>
|
||||
</button>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue