From 7d687a2298f561e4df5d8d856a00b6b10bdb3268 Mon Sep 17 00:00:00 2001
From: Matthias Schoettle <git@mattsch.com>
Date: Mon, 25 Nov 2024 22:52:01 +0000
Subject: [PATCH] Fix tooltips on license pages

---
 assets/js/app.coffee | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/assets/js/app.coffee b/assets/js/app.coffee
index 732fd27..efb6495 100644
--- a/assets/js/app.coffee
+++ b/assets/js/app.coffee
@@ -40,8 +40,8 @@ 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.addClass("hint--bottom