forked from aFarkas/lazysizes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ls.custommedia.min.js
2 lines (2 loc) · 1.15 KB
/
ls.custommedia.min.js
1
2
/*! lazysizes - v4.0.1 */
!function(a,b){var c=function(){b(a.lazySizes),a.removeEventListener("lazyunveilread",c,!0)};b=b.bind(null,a,a.document),"object"==typeof module&&module.exports?b(require("lazysizes")):a.lazySizes?c():a.addEventListener("lazyunveilread",c,!0)}(window,function(a,b,c){"use strict";var d=b.documentElement;c.getCustomMedias=function(){var a=/['"]/g,d=/\s*\|\s*/g,e=/^([a-z0-9_-]+)\s*:\s*(.+)$/i,f=function(b,c){return((getComputedStyle(b,c)||{getPropertyValue:function(){}}).getPropertyValue("content")||"none").replace(a,"").trim()},g=function(a,b){a.split(d).forEach(function(a){a.match(e)&&(b[RegExp.$1]=RegExp.$2)})};return function(a,d){return a=a||c.cfg.customMedia,d=d||b.querySelector("html"),g(f(d,":before"),a),g(f(d,":after"),a),a}}(),c.updateCustomMedia=function(){var a,b,e,f=d.querySelectorAll("source[media][data-media][srcset]");for(c.getCustomMedias(),a=0,b=f.length;b>a;a++)(e=c.cfg.customMedia[f[a].getAttribute("data-media")||f[a].getAttribute("media")])&&f[a].setAttribute("media",e);for(f=d.querySelector("source[media][data-media][srcset] ~ img"),a=0,b=f.length;b>a;a++)c.uP(f[a]);c.autoSizer.checkElems()},c.getCustomMedias()});