diff --git a/bullet_train-themes-light/app/views/showcase/engine/_head.html.erb b/bullet_train-themes-light/app/views/showcase/engine/_head.html.erb index cff37c3e5..a76bbf18c 100644 --- a/bullet_train-themes-light/app/views/showcase/engine/_head.html.erb +++ b/bullet_train-themes-light/app/views/showcase/engine/_head.html.erb @@ -33,14 +33,19 @@ BulletTrain.theme = new ___theme() BulletTrain.theme.start() - document.addEventListener("DOMContentLoaded", () => { + function placeThemeSelector() { const node = document.getElementById("bullet_train_theme_selects").content.cloneNode(true) document.querySelector("main").appendChild(node) - }) + const selectorNode = document.getElementById("bt-theme-selector") + document.querySelector("main").style.paddingBottom = selectorNode.offsetHeight + "px" + } + + document.addEventListener("DOMContentLoaded", placeThemeSelector); + document.addEventListener("turbo:load", placeThemeSelector);