about summary refs log tree commit diff
path: root/app/javascript/core
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-12-19 13:52:54 +0100
committerThibaut Girka <thib@sitedethib.com>2019-12-19 13:52:54 +0100
commitab5ff638f2968e3f434e504c7caab370bf71c9c0 (patch)
tree172f2c2fc8192688b960dd2bd42ea126ad9245fb /app/javascript/core
parent66ab1f83b0d342341181e0c88da83c966391fc0c (diff)
parent902c6bed5aab12c2e97af3452f122247777226af (diff)
Merge branch 'master' into glitch-soc/master
Conflicts:
- `config/locales/en.yml`
  No real conflict, upstream added a translatable string “too close” to
  one specific to glitch-soc
- `lib/mastodon/statuses_cli.rb`
  Fixes made upstream, while changed in glitch-soc to keep bookmarked statuses
- `package.json`
  No real conflict, additional dependency in glitch-soc
Diffstat (limited to 'app/javascript/core')
-rw-r--r--app/javascript/core/admin.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/app/javascript/core/admin.js b/app/javascript/core/admin.js
index ffdabe674..e4d683dd0 100644
--- a/app/javascript/core/admin.js
+++ b/app/javascript/core/admin.js
@@ -47,7 +47,25 @@ const onDomainBlockSeverityChange = (target) => {
 
 delegate(document, '#domain_block_severity', 'change', ({ target }) => onDomainBlockSeverityChange(target));
 
+const onEnableBootstrapTimelineAccountsChange = (target) => {
+  const bootstrapTimelineAccountsField = document.querySelector('#form_admin_settings_bootstrap_timeline_accounts');
+
+  if (bootstrapTimelineAccountsField) {
+    bootstrapTimelineAccountsField.disabled = !target.checked;
+    if (target.checked) {
+      bootstrapTimelineAccountsField.parentElement.classList.remove('disabled');
+    } else {
+      bootstrapTimelineAccountsField.parentElement.classList.add('disabled');
+    }
+  }
+};
+
+delegate(document, '#form_admin_settings_enable_bootstrap_timeline_accounts', 'change', ({ target }) => onEnableBootstrapTimelineAccountsChange(target));
+
 ready(() => {
-  const input = document.getElementById('domain_block_severity');
-  if (input) onDomainBlockSeverityChange(input);
+  const domainBlockSeverityInput = document.getElementById('domain_block_severity');
+  if (domainBlockSeverityInput) onDomainBlockSeverityChange(domainBlockSeverityInput);
+
+  const enableBootstrapTimelineAccounts = document.getElementById('form_admin_settings_enable_bootstrap_timeline_accounts');
+  if (enableBootstrapTimelineAccounts) onEnableBootstrapTimelineAccountsChange(enableBootstrapTimelineAccounts);
 });