From: tomasz stryjewski Date: Mon, 9 Dec 2013 14:20:46 +0000 (+0100) Subject: default settings fallback for alert.js X-Git-Tag: 5.0.3~71^2~27^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=refs%2Fpull%2F3841%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git default settings fallback for alert.js 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 --- diff --git a/js/foundation/foundation.alert.js b/js/foundation/foundation.alert.js index 7350578ad..569d40e9a 100644 --- a/js/foundation/foundation.alert.js +++ b/js/foundation/foundation.alert.js @@ -19,7 +19,7 @@ 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 () { @@ -31,4 +31,4 @@ reflow : function () {} }; -}(jQuery, this, this.document)); \ No newline at end of file +}(jQuery, this, this.document));