Skip to content

Commit 53e8398

Browse files
committed
Fixed up and down arrow switching
On page search
1 parent 849db01 commit 53e8398

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tcf_website/templates/search/search.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,21 @@ <h3 class="mr-3">Departments</h3>
167167

168168
{% block js %}
169169
<script>
170+
document.addEventListener("DOMContentLoaded", function () {
171+
document.querySelectorAll(".hover-tcf-orange").forEach(header => {
172+
header.addEventListener("click", function () {
173+
let icon = this.querySelector("i.fas.fa-chevron-down, i.fas.fa-chevron-up");
174+
console.log("Icon found:", icon);
175+
176+
if (icon) {
177+
icon.classList.toggle("fa-chevron-down");
178+
icon.classList.toggle("fa-chevron-up");
179+
} else {
180+
console.warn("Icon not found.");
181+
}
182+
});
183+
});
184+
});
170185
// Search results should display some content at all times
171186
// Thus the current open accordion will not be able to close itself
172187
$('[data-toggle="collapse"]').on('click',function(e) {

0 commit comments

Comments
 (0)