Skip to content

Commit

Permalink
Toggle arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
jurplel committed Aug 26, 2024
1 parent 7aed54c commit acc4551
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions assets/js/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ document.querySelectorAll('a[id^="toggleButton"]').forEach(button => {
const idNumber = button.id.replace('toggleButton', '');
const correspondingDiv = document.getElementById(`toggleDiv${idNumber}`);

console.log("adding listener")

button.addEventListener('click', () => {
console.log("ping ")
correspondingDiv.classList.toggle('hidden');
if (button.textContent.includes("▲")) {
button.textContent = "Details ▼"
} else {
button.textContent = "Details ▲"
}
});
});
2 changes: 1 addition & 1 deletion schedule.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ eleventyNavigation:
<tr>
<td>
<h2 class="mt-0 mb-2 italic font-bold">{{ entry.title }}</h2>
<a href="#/" id="toggleButton{{loop.index}}">Details &#x25BC;</a>
<a href="#/" id="toggleButton{{loop.index}}">Details </a>
<ul id="toggleDiv{{loop.index}}" class="hidden">
{% if entry.details_released %}
{% for topic in entry.agenda %}
Expand Down

0 comments on commit acc4551

Please sign in to comment.