From 80e1f89c7edac3a37d13fbdb4a22e47a88fa631c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Jun 2026 13:13:23 -0700 Subject: [PATCH] Fix js issues on loading due to turbo config --- assets/brain.js | 5 ++++- assets/landing.js | 9 ++++++--- assets/main.js | 7 ++++--- templates/brain/base.html.twig | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/brain.js b/assets/brain.js index 90c88c3..8c892f7 100644 --- a/assets/brain.js +++ b/assets/brain.js @@ -119,6 +119,9 @@ const photosUploadInit = () => { }; } -init(); + +document.addEventListener('turbo:load', (event) => { + init(); +}); diff --git a/assets/landing.js b/assets/landing.js index ae1fb26..63635b5 100644 --- a/assets/landing.js +++ b/assets/landing.js @@ -57,6 +57,9 @@ const scrollTo = () => { }); } -mobileMenu(); -jobInfoToggle(); -scrollTo(); \ No newline at end of file + +document.addEventListener('turbo:load', (event) => { + mobileMenu(); + jobInfoToggle(); + scrollTo(); +}); \ No newline at end of file diff --git a/assets/main.js b/assets/main.js index 9f437fd..2b9ff28 100644 --- a/assets/main.js +++ b/assets/main.js @@ -47,6 +47,7 @@ const album = () => { } - -mobileMenu(); -album(); \ No newline at end of file +document.addEventListener('turbo:load', (event) => { + mobileMenu(); + album(); +}); \ No newline at end of file diff --git a/templates/brain/base.html.twig b/templates/brain/base.html.twig index 540684c..0051621 100644 --- a/templates/brain/base.html.twig +++ b/templates/brain/base.html.twig @@ -3,7 +3,7 @@ {% block title %}Welcome!{% endblock %} - + {% block stylesheets %} {% endblock %}