diff options
Diffstat (limited to 'app/javascript/core')
-rw-r--r-- | app/javascript/core/admin.js | 10 | ||||
-rw-r--r-- | app/javascript/core/public.js | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/core/admin.js b/app/javascript/core/admin.js index 3f6f187bc..ffdabe674 100644 --- a/app/javascript/core/admin.js +++ b/app/javascript/core/admin.js @@ -1,6 +1,7 @@ // This file will be loaded on admin pages, regardless of theme. import { delegate } from 'rails-ujs'; +import ready from '../mastodon/ready'; const batchCheckboxClassName = '.batch-checkbox input[type="checkbox"]'; @@ -31,7 +32,7 @@ delegate(document, '.media-spoiler-hide-button', 'click', () => { }); }); -delegate(document, '#domain_block_severity', 'change', ({ target }) => { +const onDomainBlockSeverityChange = (target) => { const rejectMediaDiv = document.querySelector('.input.with_label.domain_block_reject_media'); const rejectReportsDiv = document.querySelector('.input.with_label.domain_block_reject_reports'); @@ -42,4 +43,11 @@ delegate(document, '#domain_block_severity', 'change', ({ target }) => { if (rejectReportsDiv) { rejectReportsDiv.style.display = (target.value === 'suspend') ? 'none' : 'block'; } +}; + +delegate(document, '#domain_block_severity', 'change', ({ target }) => onDomainBlockSeverityChange(target)); + +ready(() => { + const input = document.getElementById('domain_block_severity'); + if (input) onDomainBlockSeverityChange(input); }); diff --git a/app/javascript/core/public.js b/app/javascript/core/public.js index 33b7a207d..0f4222139 100644 --- a/app/javascript/core/public.js +++ b/app/javascript/core/public.js @@ -47,7 +47,7 @@ const getProfileAvatarAnimationHandler = (swapTo) => { return ({ target }) => { const swapSrc = target.getAttribute(swapTo); //only change the img source if autoplay is off and the image src is actually different - if(target.getAttribute('data-autoplay') === 'false' && target.src !== swapSrc) { + if(target.getAttribute('data-autoplay') !== 'true' && target.src !== swapSrc) { target.src = swapSrc; } }; |