Skip to content

Commit

Permalink
fixed some syntax errors that resulted in a merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Jehl committed Jun 20, 2012
1 parent c839311 commit 5cfe8c7
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions picturefill.js
Expand Up @@ -28,22 +28,19 @@
var picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ]; var picImg = ps[ i ].getElementsByTagName( "img" )[ 0 ];


if( matches.length ){ if( matches.length ){
if( !picImg ){ if( !picImg ){
picImg = w.document.createElement( "img" ); picImg = w.document.createElement( "img" );
picImg.alt = ps[ i ].getAttribute( "data-alt" ); picImg.alt = ps[ i ].getAttribute( "data-alt" );
ps[ i ].appendChild( picImg ); ps[ i ].appendChild( picImg );
}

picImg.src = matches.pop().getAttribute( "data-src" );
}
else if( picImg ){
ps[ i ].removeChild( picImg );
} }

picImg.src = matches.pop().getAttribute( "data-src" );
} }
else if( picImg ) { else if( picImg ){
ps[ i ].removeChild( picImg ); ps[ i ].removeChild( picImg );
} }
} }
}
}; };


// Run on resize and domready (w.load as a fallback) // Run on resize and domready (w.load as a fallback)
Expand All @@ -60,4 +57,4 @@
w.attachEvent( "onload", w.picturefill ); w.attachEvent( "onload", w.picturefill );
} }


})( this ); }( this ));

0 comments on commit 5cfe8c7

Please sign in to comment.