Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this._removeImageEntry(placeholder);
// Now that the DOM is in the final state, see if this image is already loaded.
if (this.isImageLoaded(img)) {
setTimeout(this._handleImageLoad.bind(this, {
target: img,
}), 30);
}
// When the image first loads, add the loaded class and possibly update
// the background-image property.
img.addEventListener('load', this._imageLoadHandler, false);
img.addEventListener('error', this._imageLoadHandler, false);
// Run picturefill on the new element.
picturefill({
elements: [img],
});
}