Permalink
Browse files

Moved `break` to a place where it means “break this loop” rather than…

… “break the entire script.”
  • Loading branch information...
1 parent 97d19ed commit d8f45e2ddb4ab21ed73cd0805d6112eab69b7f29 @Wilto committed Jun 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 picturefill.js
View
@@ -60,7 +60,7 @@
}
if( srcset ) {
- var screenRes = w.devicePixelRatio || 1, // Is it worth looping through reasonable matchMedia values here?
+ var screenRes = w.devicePixelRatio || 1, // Is it worth looping through reasonable matchMedia values here?
sources = srcset.split(","); // Split comma-separated `srcset` sources into an array.
for( var res = sources.length, r = res - 1; r >= 0; r-- ) { // Loop through each source/resolution in `srcset`.
@@ -76,8 +76,8 @@
this.width = ( this.cloneNode( true ).width / resMatch ); // Clone the original image into memory so the width is unaffected by page styles
}
picImg.parentNode.replaceChild( newImg, picImg );
+ break;
}
- break;
}
} else {
// No `srcset` in play, so just use the `src` value:

0 comments on commit d8f45e2

Please sign in to comment.