mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-02-13 09:13:58 -05:00
17 lines
570 B
JavaScript
17 lines
570 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const select_all_invoice = document.getElementById('select-all-invoices');
|
|
const invoices = document.querySelectorAll('.invoice-checkbox');
|
|
|
|
if (select_all_invoice) {
|
|
select_all_invoice.addEventListener('change', (e) => {
|
|
invoices.forEach(item => item.checked = e.target.checked);
|
|
});
|
|
}
|
|
|
|
invoices.forEach(item => {
|
|
item.addEventListener('change', () => {
|
|
const allChecked = Array.from(invoices).every(i => i.checked);
|
|
select_all_invoice.checked = allChecked;
|
|
});
|
|
});
|
|
}); |