Sha256: 12106ec78255d51a1ead671941a4a9e7fa7c9b80b698d459e48c547caf3b34a6
Contents?: true
Size: 1.45 KB
Versions: 2
Compression:
Stored size: 1.45 KB
Contents
/* This lazySizes extension adds better support for print. In case the user starts to print lazysizes will load all images. */ (function(window, factory) { var globalInstall = function(){ factory(window.lazySizes); window.removeEventListener('lazyunveilread', globalInstall, true); }; factory = factory.bind(null, window, window.document); if(typeof module == 'object' && module.exports){ factory(require('lazysizes')); } else if(window.lazySizes) { globalInstall(); } else { window.addEventListener('lazyunveilread', globalInstall, true); } }(window, function(window, document, lazySizes) { /*jshint eqnull:true */ 'use strict'; var config, elements, onprint, printMedia; // see also: http://tjvantoll.com/2012/06/15/detecting-print-requests-with-javascript/ if(window.addEventListener){ config = (lazySizes && lazySizes.cfg) || window.lazySizesConfig || {}; elements = config.lazyClass || 'lazyload'; onprint = function(){ var i, len; if(typeof elements == 'string'){ elements = document.getElementsByClassName(elements); } if(lazySizes){ for(i = 0, len = elements.length; i < len; i++){ lazySizes.loader.unveil(elements[i]); } } }; addEventListener('beforeprint', onprint, false); if(!('onbeforeprint' in window) && window.matchMedia && (printMedia = matchMedia('print')) && printMedia.addListener){ printMedia.addListener(function(){ if(printMedia.matches){ onprint(); } }); } } }));
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ext_yarn-0.6.0 | vendor/lazysizes/plugins/print/ls.print.js |
ext_yarn-0.5.0 | vendor/lazysizes/plugins/print/ls.print.js |