Skip to content

Commit c1e2465

Browse files
committed
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).
1 parent a337c55 commit c1e2465

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

src/content/dependencies/linkContribution.js

+23-15
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,30 @@ export default {
4242
language.encapsulate('misc.artistLink', workingCapsule => {
4343
const workingOptions = {};
4444

45+
relations.tooltip.setSlots({
46+
showExternalLinks: slots.showExternalLinks,
47+
showChronology: slots.showChronology,
48+
chronologyKind: slots.chronologyKind,
49+
});
50+
4551
workingOptions.artist =
46-
relations.textWithTooltip.slots({
47-
customInteractionCue: true,
48-
49-
text:
50-
relations.artistLink.slots({
51-
attributes: {class: 'text-with-tooltip-interaction-cue'},
52-
}),
53-
54-
tooltip:
55-
relations.tooltip.slots({
56-
showExternalLinks: slots.showExternalLinks,
57-
showChronology: slots.showChronology,
58-
chronologyKind: slots.chronologyKind,
59-
}),
60-
});
52+
(html.isBlank(relations.tooltip)
53+
? relations.artistLink
54+
: relations.textWithTooltip.slots({
55+
customInteractionCue: true,
56+
57+
text:
58+
relations.artistLink.slots({
59+
attributes: {class: 'text-with-tooltip-interaction-cue'},
60+
}),
61+
62+
tooltip:
63+
relations.tooltip.slots({
64+
showExternalLinks: slots.showExternalLinks,
65+
showChronology: slots.showChronology,
66+
chronologyKind: slots.chronologyKind,
67+
}),
68+
}));
6169

6270
if (slots.showContribution && data.contribution) {
6371
workingCapsule += '.withContribution';

0 commit comments

Comments
 (0)