| 24 | } |
| 25 | |
| 26 | export default function initToggleAllButtons(): void { |
| 27 | const initialButton = $('#toggle-all-features'); |
| 28 | // Show "Toggle All" section if the user already disabled a lot of features |
| 29 | if (countElements('.feature-checkbox:not(:checked)') > 50) { |
| 30 | $('details#toggle-all').hidden = false; |
| 31 | initialButton.hidden = true; // Hide button in "Debugging" section |
| 32 | } else { |
| 33 | initialButton.addEventListener('click', enableToggleAll); |
| 34 | } |
| 35 | |
| 36 | $('#disable-all-features').addEventListener('click', disableAllFeatures); |
| 37 | $('#enable-all-features').addEventListener('click', enableAllFeatures); |
| 38 | } |