/* * Author: Eddie Machado */ function updateViewportDimensions () { var w = window, d = document, e = d.documentElement, g = d.getElementsByTagName('body')[0], x = w.innerWidth || e.clientWidth || g.clientWidth, y = w.innerHeight || e.clientHeight || g.clientHeight; return { width:x,height:y }; } var viewport = updateViewportDimensions (); var waitForFinalEvent = ( function () { var timers = {}; return function ( callback, ms, uniqueId ) { if ( !uniqueId ) { uniqueId = "Don't call this twice without a uniqueId"; } if ( timers [ uniqueId ] ) { clearTimeout ( timers [ uniqueId ] ); } timers [uniqueId ] = setTimeout ( callback, ms ); }; } ) (); var timeToWaitForLast = 100; function loadGravatars () { viewport = updateViewportDimensions (); if ( viewport.width >= 768 ) { jQuery ( '.comment img[data-gravatar]' ).each ( function () { jQuery ( this ).attr ( 'src', jQuery ( this ).attr ( 'data-gravatar' ) ); } ); } } jQuery ( document ).ready ( function ( $ ) { loadGravatars (); } );