From: Corey Snyder Date: Tue, 1 Nov 2016 14:36:40 +0000 (-0400) Subject: Just a quick IE9 IE10 wrap X-Git-Tag: v6.3-rc1~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2445f76586db4d84c044f2dfddf7722eb1612f3e;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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. --- 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 } }