Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Commit

Permalink
Hide reject media checkbox when not relevant. (mastodon#8426)
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos authored and kyori19 committed Sep 17, 2018
1 parent 02ade6f commit 33cbf89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/javascript/packs/admin.js
Expand Up @@ -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';
}
});
3 changes: 3 additions & 0 deletions 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')

Expand Down

0 comments on commit 33cbf89

Please sign in to comment.