Added mass actions for Material design in list view

This commit is contained in:
Nicolas Lœuillet
2020-04-12 16:31:12 +02:00
parent 31e3a233a4
commit 467327771a
9 changed files with 191 additions and 2 deletions

View File

@ -2,6 +2,42 @@
* Entries
* ========================================================================== */
.mass-buttons {
margin: 5px;
#selectAll {
position: relative;
opacity: initial;
left: 0;
}
span {
padding: 3px;
}
button {
i {
font-size: 12px;
}
height: 24px;
line-height: 24px;
padding: 0 0.5rem;
}
}
.card-stacked {
input[type=checkbox] {
position: relative;
opacity: initial;
left: 0;
}
.entry-checkbox {
margin-right: 10px;
}
}
.collection {
margin: 15px 15px 0;

View File

@ -105,4 +105,17 @@ $(document).ready(() => {
$('.nav-panels').css('background', 'transparent');
return false;
});
const mainCheckboxes = document.querySelectorAll('[data-js="checkboxes-toggle"]');
if (mainCheckboxes.length) {
[...mainCheckboxes].forEach((el) => {
el.addEventListener('click', () => {
const checkboxes = document.querySelectorAll(el.dataset.toggle);
[...checkboxes].forEach((checkbox) => {
const checkboxClone = checkbox;
checkboxClone.checked = el.checked;
});
});
});
}
});