Sha256: 70674c87a13018ace2a825365de0ba29cfe1536794c95124aed3e7be454107ad
Contents?: true
Size: 712 Bytes
Versions: 85
Compression:
Stored size: 712 Bytes
Contents
/** * A promise that is resolved once the document is printed. */ // old promise not working properly, resolved in print-mode /* return new $.Deferred(function(deferred) { if (window.matchMedia) { var mediaQueryList = window.matchMedia('print'); mediaQueryList.addListener(function(mql) { if (mql.matches) { deferred.resolve(); } }); } window.onbeforeprint = deferred.resolve; }); }; */ jQuery(function($) { // now bound to pageflow.ready pageflow.ready.then(function() { $('img.print_image').each(function() { var img = $(this); if (img.data('src')) { img.attr('src', img.data('printsrc')); } }); }); });
Version data entries
85 entries across 85 versions & 1 rubygems