about summary refs log tree commit diff
path: root/app/javascript/core
diff options
context:
space:
mode:
authorStarfall <root@starfall.blue>2019-12-09 19:07:33 -0600
committerStarfall <root@starfall.blue>2019-12-09 19:09:31 -0600
commit6b34fcfef7566105e8d80ab5fee0a539c06cddbf (patch)
tree8fad2d47bf8be255d3c671c40cbfd04c2f55ed03 /app/javascript/core
parent9fbb4af7611aa7836e65ef9f544d341423c15685 (diff)
parent246addd5b33a172600342af3fb6fb5e4c80ad95e (diff)
Merge branch 'glitch'`
Diffstat (limited to 'app/javascript/core')
-rw-r--r--app/javascript/core/admin.js10
-rw-r--r--app/javascript/core/public.js2
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;
     }
   };