Skip to content
Snippets Groups Projects
Commit e687ac79 authored by Danae Savvidi's avatar Danae Savvidi :laughing:
Browse files

Merge branch '121-save-toggling-on-job-offers-page-for-students' into 'dev'

Draft: Resolve "Save toggling on Job Offers Page for Students"

Closes #121

See merge request !341
parents 0b54ccf8 2dd53603
No related branches found
No related tags found
No related merge requests found
Pipeline #965787 failed
......@@ -88,7 +88,6 @@
<div class="flex justify-end">
<button
class="fa-solid fa-chevron-down"
th:aria-expanded="${expanded}"
th:aria-controls="|edition-${edition.id}|"></button>
</div>
</td>
......@@ -97,8 +96,7 @@
<tbody
class="accordion__content"
th:id="|edition-${edition.id}|"
th:aria-expanded="${expanded}">
th:id="|edition-${edition.id}|">
<tr
th:each="offer : ${edition.offers}"
th:if="${!offer.hidden}"
......@@ -235,6 +233,22 @@
</div>
<script th:inline="text">
$(document).ready(function () {
$('[class="accordion__content"]').each(function () {
let accordionId = $(this).attr('id');
let isExpanded = localStorage.getItem(accordionId) ?? /*[[${expanded}]]*/ true;
if (localStorage.getItem(accordionId) != null) {
$('tbody[id="' + accordionId + '"], button[aria-controls="' + accordionId + '"]').attr('aria-expanded', isExpanded);
}
});
$('button, tbody.accordion__header').on('click', function () {
let accordionId = $(this).closest('tbody.accordion__header').find('button').attr('aria-controls');
let isExpanded = $(this).closest('tbody.accordion__header').find('button').attr('aria-expanded');
localStorage.setItem(accordionId, isExpanded);
});
});
$(() => {
$("#program-select").change(function () {
let url = new URL(window.location);
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment