« get me outta code hell

content: linkContribution: manually check for blank tooltip - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/content
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-06-18 18:30:01 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-06-18 22:56:17 -0300
commitf48164981521d1dedf79eea49c29378db9e16b58 (patch)
tree3e9ffa520a98904fb06b5ef2ca90927bd706b16a /src/content
parent9e361235d7403961a117dc36a3fb4fb04537ef77 (diff)
content: linkContribution: manually check for blank tooltip
This is unfortunately necessary to avoid the meaningless
'text-with-tooltip-interaction-cue' class (if there's no
tooltip).
Diffstat (limited to 'src/content')
-rw-r--r--src/content/dependencies/linkContribution.js38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js
index c43f31ca..26f0b2d7 100644
--- a/src/content/dependencies/linkContribution.js
+++ b/src/content/dependencies/linkContribution.js
@@ -42,22 +42,30 @@ export default {
       language.encapsulate('misc.artistLink', workingCapsule => {
         const workingOptions = {};
 
+        relations.tooltip.setSlots({
+          showExternalLinks: slots.showExternalLinks,
+          showChronology: slots.showChronology,
+          chronologyKind: slots.chronologyKind,
+        });
+
         workingOptions.artist =
-          relations.textWithTooltip.slots({
-            customInteractionCue: true,
-
-            text:
-              relations.artistLink.slots({
-                attributes: {class: 'text-with-tooltip-interaction-cue'},
-              }),
-
-            tooltip:
-              relations.tooltip.slots({
-                showExternalLinks: slots.showExternalLinks,
-                showChronology: slots.showChronology,
-                chronologyKind: slots.chronologyKind,
-              }),
-          });
+          (html.isBlank(relations.tooltip)
+            ? relations.artistLink
+            : relations.textWithTooltip.slots({
+                customInteractionCue: true,
+
+                text:
+                  relations.artistLink.slots({
+                    attributes: {class: 'text-with-tooltip-interaction-cue'},
+                  }),
+
+                tooltip:
+                  relations.tooltip.slots({
+                    showExternalLinks: slots.showExternalLinks,
+                    showChronology: slots.showChronology,
+                    chronologyKind: slots.chronologyKind,
+                  }),
+              }));
 
         if (slots.showContribution && data.contribution) {
           workingCapsule += '.withContribution';