♻️ refactor: format code

This commit is contained in:
2022-07-07 11:54:43 +02:00
parent 14e5edd35a
commit bfd15205cf
18 changed files with 14772 additions and 5116 deletions
+10 -10
View File
@@ -1,18 +1,18 @@
var acc = document.getElementsByClassName("accordion");
var i;
var acc = document.getElementsByClassName('accordion')
var i
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
acc[i].addEventListener('click', function () {
/* Toggle between adding and removing the "active" class,
to highlight the button that controls the panel */
this.classList.toggle("active");
this.classList.toggle('active')
/* Toggle between hiding and showing the active panel */
var panel = this.nextElementSibling;
var panel = this.nextElementSibling
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
panel.style.maxHeight = null
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}
panel.style.maxHeight = panel.scrollHeight + 'px'
}
})
}