rework checkbox function

This commit is contained in:
2023-01-16 18:30:08 -06:00
parent 9187cdb3fd
commit 0a1995c7e8
3 changed files with 24 additions and 14 deletions

View File

@@ -173,7 +173,7 @@ a {
padding-left: 8rem; padding-left: 8rem;
width: calc(100%-8rem); width: calc(100%-8rem);
min-height: calc(100vh - 8rem); min-height: calc(100vh - 8rem);
background-color: rgb(44, 44, 44, .75); background-color: rgb(44, 44, 44, .85);
padding-bottom: 1rem; padding-bottom: 1rem;
overflow: hidden; overflow: hidden;
transition: .4s; transition: .4s;
@@ -725,7 +725,14 @@ a {
transition: .4s; transition: .4s;
overflow-y: clip; overflow-y: clip;
height: auto; height: auto;
max-height: 100px; max-height: 500px;
}
.timeitem a {
color: inherit;
font-family: inherit;
font-size: inherit;
text-decoration: underline;
} }
.timeline-item{ .timeline-item{

View File

@@ -7,7 +7,9 @@
} }
.checkbox-wrapper > div { .checkbox-wrapper > div {
margin-bottom: .5em; display: inline-block;
margin-right: 1em;
margin-bottom: 1em;
} }
.checkbox-wrapper > div:last-child { .checkbox-wrapper > div:last-child {

View File

@@ -8,18 +8,19 @@ export function toggle(dir) {
allow.push(x.id); allow.push(x.id);
} }
}); });
if (allow.length === 0) {
toggles.forEach(function (x) {
allow.push(x.id);
});
}
let list = document.querySelectorAll(".checkbox-client > div"); let list = document.querySelectorAll(".checkbox-client > div");
for (let i = 0; i < list.length; i++) { if (allow.length === 0) {
list[i].classList.add("hidden" + dir); for (let i = 0; i < list.length; i++) {
for (let x = 0; x < list[i].classList.length; x++) { list[i].classList.remove("hidden" + dir);
if (allow.includes(list[i].classList[x])) { }
list[i].classList.remove("hidden" + dir); } else {
break; for (let i = 0; i < list.length; i++) {
list[i].classList.remove("hidden" + dir);
for (let x = 0; x < allow.length; x++) {
if (!list[i].classList.contains(allow[x])) {
list[i].classList.add("hidden" + dir);
break;
}
} }
} }
} }