« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/linkThing.js19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/content/dependencies/linkThing.js b/src/content/dependencies/linkThing.js
index d1f6a097..b4cfda03 100644
--- a/src/content/dependencies/linkThing.js
+++ b/src/content/dependencies/linkThing.js
@@ -76,11 +76,12 @@ export default {
   },
 
   generate(data, relations, slots, {html, language}) {
-    const {attributes} = slots;
-
     const path =
       slots.path ?? data.path;
 
+    const linkAttributes = slots.attributes;
+    const wrapperAttributes = html.attributes();
+
     const showShortName =
       (slots.preferShortName
         ? data.nameShort && data.nameShort !== data.name
@@ -104,7 +105,7 @@ export default {
         });
 
     if (slots.tooltipStyle === 'browser') {
-      attributes.add('title', data.name);
+      linkAttributes.add('title', data.name);
     }
 
     const content =
@@ -121,18 +122,24 @@ export default {
         colorStyle.setSlot('color', slots.color);
       }
 
-      attributes.add(colorStyle);
+      if (showWikiTooltip) {
+        wrapperAttributes.add(colorStyle);
+      } else {
+        linkAttributes.add(colorStyle);
+      }
     }
 
     return relations.textWithTooltip.slots({
+      attributes: wrapperAttributes,
+
       text:
         relations.linkTemplate.slots({
           path: slots.anchor ? [] : path,
           href: slots.anchor ? '' : null,
-          content,
-          attributes,
+          attributes: linkAttributes,
           hash: slots.hash,
           linkless: slots.linkless,
+          content,
         }),
 
       tooltip: