Skip to content

Commit 6691649

Browse files
authored
Merge pull request #1259 from mschoettle/fix-tooltips
Fix tooltips not showing up on license page and add rule label to tooltips
2 parents 7d8062b + 8106a1a commit 6691649

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

assets/js/app.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ class Choosealicense
4040
# Dynamically add annotations as title attribute to rule list items
4141
for ruletype, rules of window.annotations
4242
for rule in rules
43-
# Only select license elements in table, not legend
44-
licenseLiElement = $("td.license-#{ruletype} .#{rule["tag"]}")
43+
# Exclude license elements in the legend
44+
licenseLiElement = $(".license-#{ruletype} .#{rule["tag"]}").not("dd.license-#{ruletype} .#{rule["tag"]}")
4545
tooltipAttr = @tooltipAttributesMapperByRuleType[ruletype]
46-
licenseLiElement.attr "aria-label", "#{tooltipAttr.heading}: #{rule.description}"
46+
licenseLiElement.attr "aria-label", "#{rule.label} #{tooltipAttr.heading.toLowerCase()}: #{rule.description}"
4747
licenseLiElement.addClass("hint--bottom
4848
hint--large
4949
hint--no-animate

0 commit comments

Comments
 (0)