add shared link form fields preferences

This commit is contained in:
Alex Turchyn
2025-06-13 16:14:19 +03:00
committed by Pete Matsyburka
parent b4f80422eb
commit 18ee2d5316
11 changed files with 457 additions and 115 deletions
@@ -0,0 +1,17 @@
export default class extends HTMLElement {
connectedCallback () {
this.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
checkbox.addEventListener('change', this.handleChange)
})
}
handleChange = () => {
if (this.checkedCount !== 0) {
this.closest('form')?.requestSubmit()
}
}
get checkedCount () {
return this.querySelectorAll('input[type="checkbox"]:checked').length
}
}