From: Corey Snyder Date: Wed, 11 Jan 2017 18:30:07 +0000 (-0500) Subject: removing unneeded function X-Git-Tag: 6.3.1~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9630%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git removing unneeded function eventsListener() is the init of mutation, removing old function and comments. --- diff --git a/js/foundation.util.triggers.js b/js/foundation.util.triggers.js index 50b3f360d..8bee69966 100644 --- a/js/foundation.util.triggers.js +++ b/js/foundation.util.triggers.js @@ -76,7 +76,6 @@ function checkListeners() { eventsListener(); resizeListener(); scrollListener(); - mutateListener(); closemeListener(); } @@ -156,17 +155,6 @@ function scrollListener(debounce){ } } -function mutateListener(debounce) { - 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'); - }); - } - } - function eventsListener() { if(!MutationObserver){ return false; } let nodes = document.querySelectorAll('[data-resize], [data-scroll], [data-mutate]'); @@ -220,38 +208,3 @@ Foundation.IHearYou = checkListeners; // Foundation.IFeelYou = closemeListener; }(jQuery); - -// function domMutationObserver(debounce) { -// // !!! This is coming soon and needs more work; not active !!! // -// var timer, -// nodes = document.querySelectorAll('[data-mutate]'); -// // -// if (nodes.length) { -// // var MutationObserver = (function () { -// // var prefixes = ['WebKit', 'Moz', 'O', 'Ms', '']; -// // for (var i=0; i < prefixes.length; i++) { -// // if (prefixes[i] + 'MutationObserver' in window) { -// // return window[prefixes[i] + 'MutationObserver']; -// // } -// // } -// // return false; -// // }()); -// -// -// //for the body, we need to listen for all changes effecting the style and class attributes -// var bodyObserver = new MutationObserver(bodyMutation); -// bodyObserver.observe(document.body, { attributes: true, childList: true, characterData: false, subtree:true, attributeFilter:["style", "class"]}); -// -// -// //body callback -// function bodyMutation(mutate) { -// //trigger all listening elements and signal a mutation event -// if (timer) { clearTimeout(timer); } -// -// timer = setTimeout(function() { -// bodyObserver.disconnect(); -// $('[data-mutate]').attr('data-events',"mutate"); -// }, debounce || 150); -// } -// } -// }