stefangabos / Zebra_Dialog

A small, compact, and highly configurable jQuery plugin for creating beautiful modal dialog boxes
https://stefangabos.github.io/Zebra_Dialog/flat.html
Other
155 stars 67 forks source link

Provide a way to know when a dialog is opening #39

Open LukeSavefrogs opened 4 years ago

LukeSavefrogs commented 4 years ago

Similar to the onClose event it would be useful to have an onOpen event.

It would be even better in my opinion if they were properties of the config object. Example:

$.Zebra_Dialog("Test onOpen", {
    title: "Test Title",
    onOpen: function () {
          console.log("Dialog has opened")
    },
    onClose: function () {
          console.log("Dialog has closed")
    }
});

The onClose event could still be present to add retrocompatibility.


This way i think it would be less polluted with "anonymous" events (an onClose event could be from any library or framework)

What do you think?