Skip to content

Commit

Permalink
fix: listen for turbo:load event to initialize modal JS
Browse files Browse the repository at this point in the history
  • Loading branch information
stufro committed Apr 8, 2023
1 parent fb9ff46 commit b7c49d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/javascript/modal.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down

0 comments on commit b7c49d4

Please sign in to comment.