combine LoadCSS into CSS-Lazy-Load.js
-
Hi,
Is there a particular reason loadcss and css-lazy-load are in different files ? You
could save a request if you combine the two and minify into css-lazy-load.js:!function(e){"use strict";var n=function(n,t,i){function s(e){if(a.body)return e();setTimeout(function(){s(e)})}function o(){l.addEventListener&&l.removeEventListener("load",o),l.media=i||"all"}var r,a=e.document,l=a.createElement("link");if(t)r=t;else{var d=(a.body||a.getElementsByTagName("head")[0]).childNodes;r=d[d.length-1]}var f=a.styleSheets;l.rel="stylesheet",l.href=n,l.media="only x",s(function(){r.parentNode.insertBefore(l,t?r:r.nextSibling)});var c=function(e){for(var n=l.href,t=f.length;t--;)if(f[t].href===n)return e();setTimeout(function(){c(e)})};return l.addEventListener&&l.addEventListener("load",o),l.onloadcssdefined=c,c(o),l};"undefined"!=typeof exports?exports.loadCSS=n:e.loadCSS=n}("undefined"!=typeof global?global:this),function(e){"use strict";e(function(){if("undefined"!=typeof WpDisableAsyncLinks&&Object.keys(WpDisableAsyncLinks).length){var e;for(e in WpDisableAsyncLinks)WpDisableAsyncLinks.hasOwnProperty(e)&&loadCSS(WpDisableAsyncLinks[e])}})}(jQuery);
Edit: Could you update github? I would love to submit some pull request to https://github.com/hosting-io/wp-disable
- The topic ‘combine LoadCSS into CSS-Lazy-Load.js’ is closed to new replies.