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

save toggling state

parent 0b54ccf8
No related branches found
No related tags found
2 merge requests!343Deploy 2.1.7,!341Resolve "Save toggling on Job Offers Page for Students"
Pipeline #965779 failed
......@@ -235,6 +235,25 @@
</div>
<script th:inline="text">
$(document).ready(function () {
$('button').on('click', function () {
let accordionId = $(this).attr('aria-controls');
let isExpanded = $(this).attr('aria-expanded');
console.log("(click) change state of "+accordionId+" to " + isExpanded);
localStorage.setItem(accordionId, isExpanded);
});
$('[class="accordion__content"]').each(function () {
let accordionId = $(this).attr('id');
let isExpanded = localStorage.getItem(accordionId);
if (isExpanded !== null) {
console.log("update state of "+accordionId+" to " + isExpanded);
$('tbody[id="' + accordionId + '"]').attr('aria-expanded', isExpanded);
$('button[aria-controls="' + accordionId + '"]').attr('aria-expanded', 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