Refactor code structure and remove redundant changes

This commit is contained in:
Marek Lesko
2025-08-05 11:50:31 +02:00
parent 0019c5c601
commit b34826f9bf
374 changed files with 49565 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
const nice_checkbox = () => {
const allChecboxItems = document.querySelectorAll(".checkbox-item");
if (allChecboxItems?.length) {
allChecboxItems.forEach((checkboxItem, idx) => {
const checkbox = checkboxItem.querySelector("input[type='checkbox']");
if (checkbox) {
const checkmark = checkbox
.closest(".checkbox-item")
.querySelector(".checkmark");
if (checkbox.checked) {
checkmark.classList.add("active");
} else {
checkmark.classList.remove("active");
}
checkbox.addEventListener("change", function () {
const value = this.checked;
const checkmark =
this.closest(".checkbox-item").querySelector(".checkmark");
if (value) {
checkmark.classList.add("active");
} else {
checkmark.classList.remove("active");
}
});
}
});
}
};