diff options
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 |
commit | f48164981521d1dedf79eea49c29378db9e16b58 (patch) | |
tree | 3e9ffa520a98904fb06b5ef2ca90927bd706b16a /src | |
parent | 9e361235d7403961a117dc36a3fb4fb04537ef77 (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')
-rw-r--r-- | src/content/dependencies/linkContribution.js | 38 |
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'; |