about summary refs log tree commit diff
path: root/app
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
parent793eea29823a44fd4950f87898ecf0ff3b49351d (diff)
Hide reject media checkbox when not relevant. (#8426)
Diffstat (limited to 'app')
-rw-r--r--app/javascript/packs/admin.js7
-rw-r--r--app/views/admin/domain_blocks/new.html.haml3
2 files changed, 10 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';
+  }
+});
diff --git a/app/views/admin/domain_blocks/new.html.haml b/app/views/admin/domain_blocks/new.html.haml
index 38fa90169..2b8b24e23 100644
--- a/app/views/admin/domain_blocks/new.html.haml
+++ b/app/views/admin/domain_blocks/new.html.haml
@@ -1,3 +1,6 @@
+- content_for :header_tags do
+  = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
+
 - content_for :page_title do
   = t('.title')