Skip to content

Commit

Permalink
Fix homepage links - thanks @minh-biocommons
Browse files Browse the repository at this point in the history
  • Loading branch information
supernord committed Jun 20, 2024
1 parent fdc93a9 commit 58a2440
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions _includes/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ <h2>Relevant tools and resources</h2>
endunless %} {%- endfor %}
<td>
<div>
{% if tool.homepage %}
<a href="{{tool.homepage}}">{{tool.name}}</a>
{%- else %} {{tool.name}} {%- endif %}
{% if tool.homepage != "" %}
<a href="{{ tool.homepage }}">{{ tool.name }}</a>
{% else %}
<a href="#" class="no-link">{{ tool.name }}</a>
{% endif %}
</div>
</td>
<td>{% if tool.description %} {{tool.description}} {%- endif %}</td>
Expand Down Expand Up @@ -384,6 +386,9 @@ <h5 class="modal-title">Publications</h5>
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");
Expand Down
2 changes: 2 additions & 0 deletions _sass/_custom_classes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

0 comments on commit 58a2440

Please sign in to comment.