Merge "ParserOptions: added comment regarding editsections usage."
[lhc/web/wiklou.git] / resources / src / jquery / jquery.hidpi.js
index 71b083b..2b9bf7a 100644 (file)
@@ -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].substr( 0, bits[1].length - 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;