strawdynamics / luminous

A simple, lightweight, no-dependencies JavaScript lightbox
BSD 2-Clause "Simplified" License
777 stars 70 forks source link

onChange doesn't work #595

Open andreymal opened 2 years ago

andreymal commented 2 years ago

I tried to use dist/luminous.min.js (commit https://github.com/imgix/luminous/commit/1c53f53e2471022e95ebcd69567e948b6ef225b9) and found that onChange doesn't work:

new LuminousGallery(
  document.querySelectorAll('.gallery-item a'),
  {onChange: ({ imgEl }) => alert('This alert will never be triggered')},
);

But this code works:

new LuminousGallery(
  document.querySelectorAll('.gallery-item a'),
  {M: ({ j }) => alert('It works WHAT THE HECK!!!11')},
);

The minification minified things that shouldn't have been minified, lol

sherwinski commented 2 years ago

Hey @andreymal thanks for bringing this to our attention. I've made a note of this and will ask one of our engineers to investigate.