Skip to content

Commit

Permalink
Merge pull request #1259 from mschoettle/fix-tooltips
Browse files Browse the repository at this point in the history
Fix tooltips not showing up on license page and add rule label to tooltips
  • Loading branch information
mlinksva authored Nov 26, 2024
2 parents 7d8062b + 8106a1a commit 6691649
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class Choosealicense
# Dynamically add annotations as title attribute to rule list items
for ruletype, rules of window.annotations
for rule in rules
# Only select license elements in table, not legend
licenseLiElement = $("td.license-#{ruletype} .#{rule["tag"]}")
# Exclude license elements in the legend
licenseLiElement = $(".license-#{ruletype} .#{rule["tag"]}").not("dd.license-#{ruletype} .#{rule["tag"]}")
tooltipAttr = @tooltipAttributesMapperByRuleType[ruletype]
licenseLiElement.attr "aria-label", "#{tooltipAttr.heading}: #{rule.description}"
licenseLiElement.attr "aria-label", "#{rule.label} #{tooltipAttr.heading.toLowerCase()}: #{rule.description}"
licenseLiElement.addClass("hint--bottom
hint--large
hint--no-animate
Expand Down

0 comments on commit 6691649

Please sign in to comment.