1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-01-17 21:28:30 +01:00

Correctly toggle share settings (#581)

This commit is contained in:
Kovah 2022-12-14 23:48:20 +01:00
parent 7decde4b80
commit a3a7209fe1
No known key found for this signature in database
GPG Key ID: AAAA031BA9830D7B

View File

@ -2,14 +2,16 @@ export default class ShareToggleAll {
constructor ($el) {
this.$toggle = $el;
this.state = false;
this.shareToggles = document.documentElement.querySelectorAll('.sharing-checkbox-input');
this.$toggle.addEventListener('click', this.onToggleClick.bind(this));
}
onToggleClick () {
this.state = !this.state
this.shareToggles.forEach(toggle => {
toggle.checked = !toggle.checked;
toggle.checked = this.state;
})
}
}