instatiate lightbox only when needed, slight hack
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user