diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-01-13 15:51:44 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-01-13 20:30:57 -0400 |
commit | 35720bd44ef2d6d2a2de4ca4946bfc9ee108d4a8 (patch) | |
tree | da2297b2bba31e2ecabfbb86657bf1619ccaa66f /src/content | |
parent | 574b2714fbd7b195a0862e467b4b85ad6b6ed866 (diff) |
content: linkContribution: use generateTooltip
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/dependencies/linkContribution.js | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/content/dependencies/linkContribution.js b/src/content/dependencies/linkContribution.js index 64382a57..f3d6e4f2 100644 --- a/src/content/dependencies/linkContribution.js +++ b/src/content/dependencies/linkContribution.js @@ -1,7 +1,12 @@ import {empty} from '#sugar'; export default { - contentDependencies: ['linkArtist', 'linkExternalAsIcon'], + contentDependencies: [ + 'generateTooltip', + 'linkArtist', + 'linkExternalAsIcon', + ], + extraDependencies: ['html', 'language'], relations(relation, contribution) { @@ -10,6 +15,9 @@ export default { relations.artistLink = relation('linkArtist', contribution.who); + relations.tooltip = + relation('generateTooltip'); + if (!empty(contribution.who.urls)) { relations.artistIcons = contribution.who.urls @@ -64,19 +72,21 @@ export default { if (hasExternalIcons && slots.iconMode === 'tooltip') { content = [ content, - html.tag('span', {class: ['icons', 'tooltip', 'icons-tooltip']}, - {[html.noEdgeWhitespace]: true}, + relations.tooltip.slots({ + attributes: + {class: ['icons', 'icons-tooltip']}, - html.tag('span', {class: 'tooltip-content'}, - {[html.noEdgeWhitespace]: true}, + contentAttributes: {[html.joinChildren]: ''}, + content: relations.artistIcons .map(icon => icon.slots({ context: 'artist', withText: true, - })))), + })), + }), ]; } |