-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathls.attrchange.min.js
3 lines (2 loc) · 1.76 KB
/
ls.attrchange.min.js
1
2
3
/*! lazysizes - v5.3.2 */
!function(e,t){var n;e&&(n=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",n,!0)},t=t.bind(null,e,e.document),"object"==typeof module&&module.exports?t(require("lazysizes")):"function"==typeof define&&define.amd?define(["lazysizes"],t):e.lazySizes?n():e.addEventListener("lazyunveilread",n,!0))}("undefined"!=typeof window?window:0,function(f,v,y){"use strict";var b=function(){function e(e){for(var t,n,a=0,i=e.length;a<i;a++)(n=(t=e[a]).target).getAttribute(t.attributeName)&&("source"==n.localName&&n.parentNode&&(n=n.parentNode.querySelector("img")),n&&l.test(n.className)&&function(e){y.rAF(function(){y.rC(e,o.loadedClass),o.unloadedClass&&y.rC(e,o.unloadedClass),y.aC(e,o.lazyClass),("none"==e.style.display||e.parentNode&&"none"==e.parentNode.style.display)&&setTimeout(function(){y.loader.unveil(e)},0)})}(n))}var t,n,a,i,s,r,o=y.cfg,d={"data-bgset":1,"data-include":1,"data-poster":1,"data-bg":1,"data-script":1},l="(\\s|^)("+o.loadedClass,u=v.documentElement;function c(){e(r),s=!(r=[])}o.unloadedClass&&(l+="|"+o.unloadedClass),l+="|"+o.loadingClass+")(\\s|$)",l=new RegExp(l),d[o.srcAttr]=1,d[o.srcsetAttr]=1,n=f.MutationObserver?(a=new MutationObserver(e),t=function(){i||(i=!0,a.observe(u,{subtree:!0,attributes:!0,attributeFilter:Object.keys(d)}))},function(){i&&(i=!1,a.disconnect())}):(u.addEventListener("DOMAttrModified",(r=[],function(e){i&&d[e.attrName]&&e.newValue&&(r.push({target:e.target,attributeName:e.attrName}),s||(setTimeout(c),s=!0))}),!0),t=function(){i=!0},function(){i=!1}),addEventListener("lazybeforeunveil",n,!0),addEventListener("lazybeforeunveil",t),addEventListener("lazybeforesizes",n,!0),addEventListener("lazybeforesizes",t),t(),removeEventListener("lazybeforeunveil",b)};addEventListener("lazybeforeunveil",b)});