instatiate lightbox only when needed, slight hack
This commit is contained in:
@ -47,3 +47,7 @@
|
||||
= link_to edit_picture_path(picture) do
|
||||
%button.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
|
||||
Edit Picture
|
||||
:javascript
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
const lightbox = GLightbox({ });
|
||||
});
|
||||
|
@ -1,3 +1,8 @@
|
||||
.mx-20.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-3.2xl:grid-cols-4.gap-8.md:gap-12.lg:gap-16
|
||||
- Picture.all.limit(4).each do |picture|
|
||||
= render "pictures/picture" , picture: picture
|
||||
|
||||
:javascript
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
const lightbox = GLightbox({ });
|
||||
});
|
||||
|
@ -16,3 +16,6 @@
|
||||
New Picture
|
||||
|
||||
:javascript
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
const lightbox = GLightbox({ });
|
||||
});
|
||||
|
Reference in New Issue
Block a user