add shared link form fields preferences

This commit is contained in:
Alex Turchyn authored and Pete Matsyburka committed 2025-06-28 23:06:25 +03:00
1 parent b4f80422eb
commit 18ee2d5316
11 files changed
+457 -115

No files matched your search

@@ -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
}
}