]> cat aescling's git repositories - mastodon.git/commitdiff
Fix CW issues in static view on Safari (Fixes #8354) (#8446)
authorPatrickRWells <32802366+PatrickRWells@users.noreply.github.com>
Sat, 25 Aug 2018 23:19:13 +0000 (16:19 -0700)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 25 Aug 2018 23:19:13 +0000 (01:19 +0200)
* Fix CW issues in static view on Safari (8354)

* Fixed formatting issues

* Trailing space

app/javascript/packs/public.js

index dc18da8534187b6cfc56c3df80dcdb7e3966c1b4..c83e2889a0822bf0428f654bc1cae53a554b0c11 100644 (file)
@@ -79,7 +79,10 @@ function main() {
         .catch(error => console.error(error));
     }
 
-    new Rellax('.parallax', { speed: -1 });
+    const parallaxComponents = document.querySelectorAll('.parallax');
+    if (parallaxComponents.length > 0 ) {
+      new Rellax('.parallax', { speed: -1 });
+    }
 
     const history = createHistory();
     const detailedStatuses = document.querySelectorAll('.public-layout .detailed-status');