From 360b8f8cc3a1b789da8f4cf15cec5b0270f7feb1 Mon Sep 17 00:00:00 2001 From: Chris Oyler Date: Thu, 14 Jan 2016 13:28:31 -0800 Subject: [PATCH] fixes #7880, improves fallback for data-closable elements, if no parameter passed to the data-closable attribute, now falls back to jquery fadeOut method. include a Motion UI class in the attribute to take advantage of the extra animations, and ensure you have Motion UI loaded --- js/foundation.util.triggers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/foundation.util.triggers.js b/js/foundation.util.triggers.js index 523690270..46cb971dc 100644 --- a/js/foundation.util.triggers.js +++ b/js/foundation.util.triggers.js @@ -27,8 +27,9 @@ // Elements with [data-closable] will respond to close.zf.trigger events. $(document).on('close.zf.trigger', '[data-closable]', function(e){ e.stopPropagation(); - var animation = $(this).data('closable') || 'fade-out'; - if(Foundation.Motion){ + var animation = $(this).data('closable'); + + if(animation !== ''){ Foundation.Motion.animateOut($(this), animation, function() { $(this).trigger('closed.zf'); }); -- 2.47.2