From 58a244058248f8a5ddcefc846bcd055e9340cf5c Mon Sep 17 00:00:00 2001 From: Johan Gustafsson Date: Thu, 20 Jun 2024 10:35:05 +0930 Subject: [PATCH] Fix homepage links - thanks @minh-biocommons --- _includes/table.html | 11 ++++++++--- _sass/_custom_classes.scss | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/_includes/table.html b/_includes/table.html index e6d0672..b54a102 100644 --- a/_includes/table.html +++ b/_includes/table.html @@ -160,9 +160,11 @@

Relevant tools and resources

endunless %} {%- endfor %}
- {% if tool.homepage %} - {{tool.name}} - {%- else %} {{tool.name}} {%- endif %} + {% if tool.homepage != "" %} + {{ tool.name }} + {% else %} + {{ tool.name }} + {% endif %}
{% if tool.description %} {{tool.description}} {%- endif %} @@ -384,6 +386,9 @@ document.querySelector(".spinner-container").style.display = "none"; document.getElementById("tool-table").classList.remove("d-none"); + // Event listener for noLinkElements + document.addEventListener('DOMContentLoaded', () => { const noLinkElements = document.querySelectorAll('a.no-link'); noLinkElements.forEach(link => { link.addEventListener('click', (event) => { event.preventDefault(); }); }); }); + // Event listener for Topic Badges table.on("draw", function () { let badges = document.querySelectorAll(".topic-badge"); diff --git a/_sass/_custom_classes.scss b/_sass/_custom_classes.scss index 53f5c6d..d7ea7df 100644 --- a/_sass/_custom_classes.scss +++ b/_sass/_custom_classes.scss @@ -59,3 +59,5 @@ h2 { } } +a.no-link { color: inherit; text-decoration: none; cursor: default; pointer-events: none; } +a.no-link:hover { color: inherit; text-decoration: none; }