From b7c49d4221985b189a7bb91bed9023263adecf08 Mon Sep 17 00:00:00 2001 From: stufro Date: Sat, 8 Apr 2023 18:46:25 +0100 Subject: [PATCH] fix: listen for turbo:load event to initialize modal JS --- app/javascript/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/modal.js b/app/javascript/modal.js index ee8fa93..92eb642 100644 --- a/app/javascript/modal.js +++ b/app/javascript/modal.js @@ -1,4 +1,4 @@ -document.addEventListener('DOMContentLoaded', () => { +document.addEventListener('turbo:load', () => { // Functions to open and close a modal function openModal($el) { $el.classList.add('is-active');