From 5c3276546b5b191eedafe1530bef1b5bae157969 Mon Sep 17 00:00:00 2001 From: tomasz stryjewski Date: Mon, 9 Dec 2013 15:20:46 +0100 Subject: [PATCH] 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 --- js/foundation/foundation.alert.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); -- 2.47.2