Use turbolinks:load event listener

We use turbolinks so the DOMContentLoaded is not enough
This commit is contained in:
bumi 2020-04-14 14:00:03 +02:00
parent 6381a19d10
commit 916511edf4
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener("turbolinks:load", function () {
const $navbarBurgers = document.querySelectorAll('.navbar-burger');
// Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {

View File

@ -1,4 +1,4 @@
document.addEventListener('DOMContentLoaded', function() {
document.addEventListener("turbolinks:load", function () {
var demoForm = document.getElementById('demo-form');
if (!demoForm) {
return;