instatiate lightbox only when needed, slight hack

This commit is contained in:
Torsten
2023-02-02 17:36:17 +02:00
parent 7478c36108
commit 5ceaff890f
4 changed files with 21 additions and 3 deletions

View File

@ -1,4 +1,10 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import GLightbox from 'glightbox';
// Configure your import map in config/importmap.rb.
// Read more: https://github.com/rails/importmap-rails
const lightbox = GLightbox({ });
// Currently haml filter does not support modules.
// import and make global as workaround
//
// haml module syntax is really clunky, filing issue and hoping
//
import GLightbox from 'glightbox';
globalThis.GLightbox = GLightbox;