Skip to content

Commit

Permalink
Correctly toggle share settings (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kovah committed Dec 14, 2022
1 parent 7decde4 commit a3a7209
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion resources/assets/js/components/ShareToggleAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
}
}

0 comments on commit a3a7209

Please sign in to comment.