From 2445f76586db4d84c044f2dfddf7722eb1612f3e Mon Sep 17 00:00:00 2001 From: Corey Snyder Date: Tue, 1 Nov 2016 10:36:40 -0400 Subject: [PATCH] Just a quick IE9 IE10 wrap so no errors are thrown to the console, also, no need for a timer on mutate, it is only fired once. --- js/foundation.util.triggers.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/js/foundation.util.triggers.js b/js/foundation.util.triggers.js index 7e13de64d..b9cbfda4f 100644 --- a/js/foundation.util.triggers.js +++ b/js/foundation.util.triggers.js @@ -152,21 +152,13 @@ function scrollListener(debounce){ } function mutateListener(debounce) { - let timer, - $nodes = $('[data-mutate]'); - if ($nodes.length) { - if (timer) { - clearTimeout(timer); - } - - timer = setTimeout(function () { - + let $nodes = $('[data-mutate]'); + if ($nodes.length && MutationObserver){ //trigger all listening elements and signal a mutate event + //no IE 9 or 10 $nodes.each(function () { $(this).triggerHandler('mutateme.zf.trigger'); }); - - }, debounce || 10); //default time to emit scroll event } } -- 2.47.2