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:
parent
7decde4b80
commit
a3a7209fe1
@ -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;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user