about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-16 18:26:49 +0200
committerGitHub <noreply@github.com>2022-05-16 18:26:49 +0200
commitb91196f4b73fff91997b8077619ae25b6d04a59e (patch)
tree9d52a2fbed1170b5180540878ff4fa9292ad3ff1 /app/javascript
parent3a084113067656ef9318b9fb5bcfea4fd2de6ffe (diff)
Add confirmation page when importing blocked domains (#1773)
* Move glitch-soc-specific strings to glitch-soc-specific locale files

* Add confirmation page when importing blocked domains
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/core/admin.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/javascript/core/admin.js b/app/javascript/core/admin.js
index ef0a8f267..c1b9f07a4 100644
--- a/app/javascript/core/admin.js
+++ b/app/javascript/core/admin.js
@@ -102,6 +102,12 @@ ready(() => {
   const registrationMode = document.getElementById('form_admin_settings_registrations_mode');
   if (registrationMode) onChangeRegistrationMode(registrationMode);
 
+  const checkAllElement = document.querySelector('#batch_checkbox_all');
+  if (checkAllElement) {
+    checkAllElement.checked = [].every.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked);
+    checkAllElement.indeterminate = !checkAllElement.checked && [].some.call(document.querySelectorAll(batchCheckboxClassName), (content) => content.checked);
+  }
+
   document.querySelector('a#add-instance-button')?.addEventListener('click', (e) => {
     const domain = document.getElementById('by_domain')?.value;