forked from aFarkas/lazysizes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ls.custommedia.min.js
3 lines (2 loc) · 1.19 KB
/
ls.custommedia.min.js
1
2
3
/*! lazysizes - v5.3.2 */
!function(e,t){var i=function(){t(e.lazySizes),e.removeEventListener("lazyunveilread",i,!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?i():e.addEventListener("lazyunveilread",i,!0)}(window,function(e,i,a){"use strict";var n,t,r,o=i.documentElement;function u(e,t){return((getComputedStyle(e,t)||{getPropertyValue:function(){}}).getPropertyValue("content")||"none").replace(n,"").trim()}function s(e,i){e.split(t).forEach(function(e){var t=e.match(r);t&&(i[t[1]]=t[2])})}a.getCustomMedias=(n=/['"]/g,t=/\s*\|\s*/g,r=/^([a-z0-9_-]+)\s*:\s*(.+)$/i,function(e,t){return e=e||a.cfg.customMedia,t=t||i.querySelector("html"),s(u(t,":before"),e),s(u(t,":after"),e),e}),a.updateCustomMedia=function(){var e,t,i,n=o.querySelectorAll("source[media][data-media][srcset]");for(a.getCustomMedias(),e=0,t=n.length;e<t;e++)(i=a.cfg.customMedia[n[e].getAttribute("data-media")||n[e].getAttribute("media")])&&n[e].setAttribute("media",i);for(e=0,t=(n=o.querySelector("source[media][data-media][srcset] ~ img")).length;e<t;e++)a.uP(n[e]);a.autoSizer.checkElems()},a.getCustomMedias()});