Skip to content

Commit

Permalink
Initialize lightbox2 when turbolinks:load is triggered in Rails
Browse files Browse the repository at this point in the history
The lightbox2 won't get initialized when this code is missing.
  • Loading branch information
mschnitzer committed Mar 11, 2019
1 parent 17e0e48 commit 232dc1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vendor/assets/javascripts/lightbox2.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,7 @@

return new Lightbox();
}));

$(document).on('turbolinks:load', function(event) {
lightbox.init();
});

0 comments on commit 232dc1a

Please sign in to comment.