Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tiny refactor

  • Loading branch information...
commit 80b2d6bf85da1368fbdca87a2c752679cc8ff47e 1 parent d334870
@hughfdjackson authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/load_images.js
View
7 src/load_images.js
@@ -7,7 +7,7 @@ void function(root){
images
// logic
- if ( image_object instanceof Array ) images = []
+ if ( Object.prototype.toString.call(image_object) == '[object Array]' ) images = []
else images = {}
for ( var prop in image_object ){
@@ -23,7 +23,7 @@ void function(root){
function load(name, url){
var image = new Image()
to_load += 1
- image.src = url
+ image.src = url
image.onload = on_load
images[name] = image
}
@@ -34,5 +34,6 @@ void function(root){
module.exports = load_images
else
root.load_images = load_images
-
+
+
}(this)
Please sign in to comment.
Something went wrong with that request. Please try again.