From 21f08b98269dd9c5766a1856f0aec0901566da2e Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 24 May 2024 00:32:42 +0300 Subject: [PATCH] Revert "improve post nav" This reverts commit 8d10bf224a86dacdeb75d1f4afe25fe048dd86e5. --- files/assets/css/main.css | 4 ---- files/assets/js/post_navigation.js | 10 ++++------ files/templates/header.html | 8 ++++---- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/files/assets/css/main.css b/files/assets/css/main.css index aadc419a0..4eee733b3 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -7877,7 +7877,3 @@ tr:has(hideme) { margin-bottom: 4rem !important; border-top: 2px solid; } - -.post_navigation:focus { - outline: none !important; -} diff --git a/files/assets/js/post_navigation.js b/files/assets/js/post_navigation.js index a76c9adcf..cb69b7ca7 100644 --- a/files/assets/js/post_navigation.js +++ b/files/assets/js/post_navigation.js @@ -14,13 +14,9 @@ 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.onclick = go_next + btn.href = permalink_after.slice(1, -1) } document.addEventListener('keydown', (e) => { @@ -30,7 +26,9 @@ if (post_permalinks) { !expandImageModal.classList.contains('show') ) { if (["ArrowRight", "d"].includes(e.key)) - go_next() + location.href = permalink_after.slice(1, -1) + if (["ArrowLeft", "a"].includes(e.key)) + history.back() } }) } diff --git a/files/templates/header.html b/files/templates/header.html index 21f677add..9a4c3771a 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -201,9 +201,9 @@ {% endif %} {% if p %} - + {% endif %} {% if g.browser == 'webview' %} @@ -259,9 +259,9 @@ {% if p %} {% endif %}