image-promise
Advanced tools
Comparing version 6.0.0 to 6.0.2
@@ -1,2 +0,2 @@ | ||
/*! npm.im/image-promise 6.0.0 */ | ||
/*! npm.im/image-promise 6.0.2 */ | ||
'use strict'; | ||
@@ -31,3 +31,3 @@ | ||
}); | ||
} else if (image.tagName !== 'IMG') { | ||
} else if (image.tagName.toUpperCase() !== 'IMG') { | ||
return Promise.reject(); | ||
@@ -46,6 +46,6 @@ } | ||
} else { | ||
image.addEventListener('load', fullfill); | ||
image.addEventListener('error', fullfill); | ||
image.addEventListener('load', fulfill); | ||
image.addEventListener('error', fulfill); | ||
} | ||
function fullfill() { | ||
function fulfill() { | ||
if (image.naturalWidth) { | ||
@@ -56,4 +56,4 @@ resolve(image); | ||
} | ||
image.removeEventListener('load', fullfill); | ||
image.removeEventListener('error', fullfill); | ||
image.removeEventListener('load', fulfill); | ||
image.removeEventListener('error', fulfill); | ||
} | ||
@@ -60,0 +60,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/*! npm.im/image-promise 6.0.0 */ | ||
/*! npm.im/image-promise 6.0.2 */ | ||
function load(image, attributes) { | ||
@@ -29,3 +29,3 @@ if (!image) { | ||
}); | ||
} else if (image.tagName !== 'IMG') { | ||
} else if (image.tagName.toUpperCase() !== 'IMG') { | ||
return Promise.reject(); | ||
@@ -44,6 +44,6 @@ } | ||
} else { | ||
image.addEventListener('load', fullfill); | ||
image.addEventListener('error', fullfill); | ||
image.addEventListener('load', fulfill); | ||
image.addEventListener('error', fulfill); | ||
} | ||
function fullfill() { | ||
function fulfill() { | ||
if (image.naturalWidth) { | ||
@@ -54,4 +54,4 @@ resolve(image); | ||
} | ||
image.removeEventListener('load', fullfill); | ||
image.removeEventListener('error', fullfill); | ||
image.removeEventListener('load', fulfill); | ||
image.removeEventListener('error', fulfill); | ||
} | ||
@@ -58,0 +58,0 @@ }); |
{ | ||
"name": "image-promise", | ||
"version": "6.0.0", | ||
"version": "6.0.2", | ||
"description": "Load one or more images, return a promise. Only 0.4KB, for the browser, no dependencies.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
8371