From e77262e34657164b5c194d2e639ff4ce627134a9 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 14 Aug 2024 13:03:39 -0300 Subject: content, css, client: inert previous/next links --- src/static/css/site.css | 4 ++++ src/static/js/client/scripted-link.js | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/static') diff --git a/src/static/css/site.css b/src/static/css/site.css index aa41746b..a46c0927 100644 --- a/src/static/css/site.css +++ b/src/static/css/site.css @@ -870,6 +870,10 @@ a:not([href]):hover { text-align: center; } +.inert-previous-next-link { + opacity: 0.7; +} + .nowrap { white-space: nowrap; } diff --git a/src/static/js/client/scripted-link.js b/src/static/js/client/scripted-link.js index 5db86e13..ca1c2548 100644 --- a/src/static/js/client/scripted-link.js +++ b/src/static/js/client/scripted-link.js @@ -190,11 +190,16 @@ export function mutatePageContent() { } function mutateNavigationLinkContent() { - const prependTitle = (el, prepend) => - el?.setAttribute('title', + const prependTitle = (el, prepend) => { + if (!el) return; + if (!el.hasAttribute('href')) return; + + el?.setAttribute( + 'title', (el.hasAttribute('title') ? prepend + ' ' + el.getAttribute('title') : prepend)); + }; prependTitle(info.nextNavLink, '(Shift+N)'); prependTitle(info.previousNavLink, '(Shift+P)'); -- cgit 1.3.0-6-gf8a5