ender-overlay
ender-overlay copied to clipboard
onBeforeClose gets triggered on open
For example, if I create an overlay with following code
var box = $('#overlay').overlay({
allowMultipleDisplay: false, // Also the default value.
onBeforeClose: function() {
console.log("Close triggered");
}
});
// Opening the 'box' will output "Close triggered" to console.
box.open();
> "Close triggered"
I did a little digging and found that this if clause
if (opt.onBeforeClose(api) === false ||
this.$overlay.css('display') !== 'block') {
return;
}
executes onBeforeClose function regardless of overlay's current visibility state.
I think the conditions in the if clause should be the other way around (like they are for onBeforeOpen function). What do you think?