diff --git a/files/assets/js/comments+submission_listing.js b/files/assets/js/comments+submission_listing.js index 1d1899d95..a8988cd4e 100644 --- a/files/assets/js/comments+submission_listing.js +++ b/files/assets/js/comments+submission_listing.js @@ -39,7 +39,7 @@ function popclick(e) { let popover = document.getElementsByClassName("popover") popover = popover[popover.length-1] - if (popover.getElementsByClassName('pop-badges').length > 0) { + if (popover.getElementsByClassName('pop-badges')) { const badgesDOM = popover.getElementsByClassName('pop-badges')[0]; badgesDOM.innerHTML = ""; for (const badge of author["badges"]) { @@ -65,6 +65,12 @@ function popclick(e) { }, 5); } +for (const element of document.getElementsByClassName('user-name')) { + element.onclick = (e) => { + popclick(e); + }; +} + document.addEventListener("click", function(){ active = document.activeElement.getAttributeNode("class"); if (active && active.nodeValue == "user-name text-decoration-none"){ diff --git a/files/templates/comments.html b/files/templates/comments.html index 3277caf79..90d6106d3 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -168,7 +168,7 @@ {% if c.author.verified %} {% endif %} - +
{% if c.author.hat_active(v)[0] -%} diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index 0a295578f..0b24617dc 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -84,7 +84,7 @@ {% if p.author.verified %} {% endif %} - +
{% if p.author.hat_active(v)[0] -%}