« get me outta code hell

content, css, client: inert previous/next links - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/client
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-08-14 13:03:39 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-11-02 22:25:46 -0300
commite77262e34657164b5c194d2e639ff4ce627134a9 (patch)
treef64a67f47990bf50bbfa0b78b4b5e65eda7596a2 /src/static/js/client
parent7c5939aefafc88201eb73ba67a35d4de77c94d7a (diff)
content, css, client: inert previous/next links
Diffstat (limited to 'src/static/js/client')
-rw-r--r--src/static/js/client/scripted-link.js9
1 files changed, 7 insertions, 2 deletions
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)');