diff options
author | pluralcafe-docker <git@plural.cafe> | 2018-10-01 05:42:11 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2018-10-01 05:42:11 +0000 |
commit | f9275cb762a311cbf298b3929552a153703c0726 (patch) | |
tree | 35797a6c1ae1c51d5e42ffe8b63eecbfb4336f56 /app/javascript/packs/public.js | |
parent | 2aedb7e83cf7a2c1a7de69d2bc20808f20c10f8f (diff) | |
parent | 4e60a0d5433f5dfa4f71a452cc5c6ceb0f21ceab (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/javascript/packs/public.js')
-rw-r--r-- | app/javascript/packs/public.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 1cb491e17..a62974ec0 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -52,6 +52,7 @@ function main() { }); const reactComponents = document.querySelectorAll('[data-component]'); + if (reactComponents.length > 0) { import(/* webpackChunkName: "containers/media_container" */ '../mastodon/containers/media_container') .then(({ default: MediaContainer }) => { @@ -64,6 +65,7 @@ function main() { } const parallaxComponents = document.querySelectorAll('.parallax'); + if (parallaxComponents.length > 0 ) { new Rellax('.parallax', { speed: -1 }); } @@ -71,6 +73,7 @@ function main() { const history = createHistory(); const detailedStatuses = document.querySelectorAll('.public-layout .detailed-status'); const location = history.location; + if (detailedStatuses.length === 1 && (!location.state || !location.state.scrolledToDetailedStatus)) { detailedStatuses[0].scrollIntoView(); history.replace(location.pathname, { ...location.state, scrolledToDetailedStatus: true }); |