-
-
Notifications
You must be signed in to change notification settings - Fork 65
Fix Dropdown Arrow Direction for “Latest New 2025” #576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Dropdown Arrow Direction for “Latest New 2025” #576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes were made to this file. Please remove it file from the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes were made to this file. Please remove it file from the PR.
Yes. I will remove it. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These libraries are already imported and don' t need to be include here.
|
|
||
| {{ partial "footer.html" . }} | ||
|
|
||
| <script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this extra Javascript.
| <a class="d-block h3 text-dark text-decoration-none" | ||
| data-bs-toggle="collapse" | ||
| data-bs-target="#{{ $collapseID }}" | ||
| aria-expanded="{{ if eq $year $currentYear }}true{{ else }}false{{ end }}" | ||
| aria-controls="{{ $collapseID }}"> | ||
|
|
||
| <i id="icon-{{ $collapseID }}" | ||
| class="fa-solid {{ if eq $year $currentYear }}fa-chevron-up{{ else }}fa-chevron-down{{ end }} me-2"> | ||
| </i> | ||
| {{ $year }} | ||
| </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use this without the extra Javascript, and please be careful to maintain the proper indentation. I know it is not great everywhere, but we should at least improve it when we are making a change.
| <a class="d-block h3 text-dark text-decoration-none" | |
| data-bs-toggle="collapse" | |
| data-bs-target="#{{ $collapseID }}" | |
| aria-expanded="{{ if eq $year $currentYear }}true{{ else }}false{{ end }}" | |
| aria-controls="{{ $collapseID }}"> | |
| <i id="icon-{{ $collapseID }}" | |
| class="fa-solid {{ if eq $year $currentYear }}fa-chevron-up{{ else }}fa-chevron-down{{ end }} me-2"> | |
| </i> | |
| {{ $year }} | |
| </a> | |
| <a class="d-block h3 text-dark text-decoration-none" | |
| data-bs-toggle="collapse" | |
| data-bs-target="#{{ $collapseID }}" | |
| role="button" | |
| href="#{{ $collapseID }}" | |
| aria-expanded="{{ if eq $year $currentYear }}true{{ else }}false{{ end }}" | |
| aria-controls="{{ $collapseID }}"> | |
| <i | |
| id="icon-{{ $collapseID }}" | |
| class="fa-solid fa-chevron-{{ if eq $year $currentYear }}down{{ else }}right{{ end }}"> | |
| </i> | |
| {{ $year }} | |
| </a> |
| <script> | ||
| document.addEventListener("DOMContentLoaded", function () { | ||
| document.querySelectorAll('[data-bs-toggle="collapse"]').forEach(function (toggle) { | ||
| toggle.addEventListener("click", function () { | ||
| const targetId = toggle.getAttribute("data-bs-target"); | ||
| const icon = document.querySelector("#icon-" + targetId.replace("#", "")); | ||
| if (!icon) return; | ||
| const target = document.querySelector(targetId); | ||
| target.addEventListener("shown.bs.collapse", function () { | ||
| icon.classList.remove("fa-chevron-down"); | ||
| icon.classList.add("fa-chevron-up"); | ||
| }); | ||
| target.addEventListener("hidden.bs.collapse", function () { | ||
| icon.classList.remove("fa-chevron-up"); | ||
| icon.classList.add("fa-chevron-down"); | ||
| }); | ||
| }); | ||
| }); | ||
| }); | ||
| </script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <script> | |
| document.addEventListener("DOMContentLoaded", function () { | |
| document.querySelectorAll('[data-bs-toggle="collapse"]').forEach(function (toggle) { | |
| toggle.addEventListener("click", function () { | |
| const targetId = toggle.getAttribute("data-bs-target"); | |
| const icon = document.querySelector("#icon-" + targetId.replace("#", "")); | |
| if (!icon) return; | |
| const target = document.querySelector(targetId); | |
| target.addEventListener("shown.bs.collapse", function () { | |
| icon.classList.remove("fa-chevron-down"); | |
| icon.classList.add("fa-chevron-up"); | |
| }); | |
| target.addEventListener("hidden.bs.collapse", function () { | |
| icon.classList.remove("fa-chevron-up"); | |
| icon.classList.add("fa-chevron-down"); | |
| }); | |
| }); | |
| }); | |
| }); | |
| </script> |
20f158c to
d4cb030
Compare
|
Continued in #580 |
PR: Fix Dropdown Arrow Direction for “Latest New 2025” ( fixes #575)
This PR fixes the issue where the dropdown arrow in “Latest New 2025” always pointed up, even when the menu was closed.
What’s Fixed
Let me know if any changes are needed. I’m open to suggestions.
Also, I’ll make sure to improve my PR workflow next time; I couldn’t raise the PR earlier as I was out of state. Thank you for assigning me this issue!