when adding alert boxes dynamically, the settings option on the alert-box is empty and throws an error when trying to close the alert-box.
this change allows to fall back to default settings, which otherwise are not accessible
events : function () {
$(this.scope).off('.alert').on('click.fndtn.alert', '[data-alert] a.close', function (e) {
var alertBox = $(this).closest("[data-alert]"),
- settings = alertBox.data('alert-init');
+ settings = alertBox.data('alert-init') || Foundation.libs.alert.settings;
e.preventDefault();
alertBox[settings.animation](settings.speed, function () {
reflow : function () {}
};
-}(jQuery, this, this.document));
\ No newline at end of file
+}(jQuery, this, this.document));