X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.hidpi.js;h=2b9bf7a313eb4b240406a77df4775d1021c3f143;hb=32d052537191da40afcd3d50f1f93cdba34db463;hp=4ecfeb884ea9b56752a0fdc6180c8aa2d5ec8f5e;hpb=5f8b92578167107e91e2b10b631de0cada0b4854;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.hidpi.js b/resources/src/jquery/jquery.hidpi.js index 4ecfeb884e..2b9bf7a313 100644 --- a/resources/src/jquery/jquery.hidpi.js +++ b/resources/src/jquery/jquery.hidpi.js @@ -73,11 +73,11 @@ $.fn.hidpi = function () { match; if ( typeof srcset === 'string' && srcset !== '' ) { match = $.matchSrcSet( devicePixelRatio, srcset ); - if (match !== null ) { + if ( match !== null ) { $img.attr( 'src', match ); } } - }); + } ); } return $target; @@ -106,11 +106,11 @@ $.matchSrcSet = function ( devicePixelRatio, srcset ) { selectedSrc = null; candidates = srcset.split( / *, */ ); for ( i = 0; i < candidates.length; i++ ) { - candidate = candidates[i]; + candidate = candidates[ i ]; bits = candidate.split( / +/ ); - src = bits[0]; - if ( bits.length > 1 && bits[1].charAt( bits[1].length - 1 ) === 'x' ) { - ratioStr = bits[1].slice( 0, -1 ); + src = bits[ 0 ]; + if ( bits.length > 1 && bits[ 1 ].charAt( bits[ 1 ].length - 1 ) === 'x' ) { + ratioStr = bits[ 1 ].slice( 0, -1 ); ratio = parseFloat( ratioStr ); if ( ratio <= devicePixelRatio && ratio > selectedRatio ) { selectedRatio = ratio;