about summary refs log tree commit diff
path: root/app/javascript/packs
diff options
context:
space:
mode:
authorM Somerville <dracos@users.noreply.github.com>2018-08-25 12:26:17 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-08-25 13:26:17 +0200
commit29da56cf75c1381b31a8b26738a94eff482f8099 (patch)
tree7814ac2495b157fd11b2b97b3fe1b72eafaf451a /app/javascript/packs
parent793eea29823a44fd4950f87898ecf0ff3b49351d (diff)
Hide reject media checkbox when not relevant. (#8426)
Diffstat (limited to 'app/javascript/packs')
-rw-r--r--app/javascript/packs/admin.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/packs/admin.js b/app/javascript/packs/admin.js
index 5dbcc03d3..ce5f70ee7 100644
--- a/app/javascript/packs/admin.js
+++ b/app/javascript/packs/admin.js
@@ -39,3 +39,10 @@ delegate(document, '.media-spoiler-hide-button', 'click', () => {
     element.click();
   });
 });
+
+delegate(document, '#domain_block_severity', 'change', ({ target }) => {
+  const rejectMediaDiv = document.querySelector('.input.with_label.domain_block_reject_media');
+  if (rejectMediaDiv) {
+    rejectMediaDiv.style.display = (target.value === 'suspend') ? 'none' : 'block';
+  }
+});