Skip to content

Commit

Permalink
Prevent ImageLoader._formatResult() from detrimentally delaying loade…
Browse files Browse the repository at this point in the history
…d Image availability in Internet Explorer
  • Loading branch information
Eric Ente committed Mar 6, 2015
1 parent 0a87ed2 commit 9d9a4bf
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 23 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ progress and complete events. Check out the [docs](http://createjs.com/Docs/Prel
* Added a checks for url parsing errors, so that you can see what url is missing a file extension and is breaking LoadQueue.
* Made a small change to XHRRequest's _checkError() to be more Cordova friendly.
* Removed version number from built files, versioning is handled by the Git tags & Bower.
* Added a fallback in ImageLoader._formatResult() to handle iOS6 and other browsers that don't do URL.createObjectURL() properly.
* Added a fallback in ImageLoader._formatResult() to handle iOS6 and other browsers that don't do URL.createObjectURL() properly.
* Prevent ImageLoader._formatResult() from detrimentally delaying loaded Image availability in Internet Explorer
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PreloadJS",
"version": "0.6.0",
"version": "0.6.1",
"homepage": "https://github.com/CreateJS/PreloadJS",
"authors": [
"gskinner",
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PreloadJS",
"version": "0.6.0",
"version": "0.6.1",
"description": "PreloadJS Docs",
"url": "http://www.createjs.com/#!/PreloadJS",
"logo": "assets/docs-icon-PreloadJS.png",
Expand Down
Binary file modified docs/PreloadJS_docs.zip
Binary file not shown.
27 changes: 17 additions & 10 deletions lib/preloadjs.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ this.createjs = this.createjs || {};
* @type {String}
* @static
**/
s.version = /*=version*/"0.6.0"; // injected by build process
s.version = /*=version*/"0.6.1"; // injected by build process

/**
* The build date for this release in UTC format.
* @property buildDate
* @type {String}
* @static
**/
s.buildDate = /*=date*/"Thu, 05 Feb 2015 19:09:21 GMT"; // injected by build process
s.buildDate = /*=date*/"Fri, 06 Mar 2015 20:34:00 GMT"; // injected by build process

})();

Expand Down Expand Up @@ -6109,21 +6109,28 @@ this.createjs = this.createjs || {};
if(objURL) {
tag.src = objURL;
tag.onload = function () {
URL.revokeObjectURL(_this.src);
URL.revokeObjectURL(this.src);
done(this);
}
}
else {
tag.src = loader.getItem().src;
if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
}
}
}
} else {
tag.src = loader.getItem().src;
}

if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
}
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions lib/preloadjs.min.js

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions src/preloadjs/loaders/ImageLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,28 @@ this.createjs = this.createjs || {};
if(objURL) {
tag.src = objURL;
tag.onload = function () {
URL.revokeObjectURL(_this.src);
URL.revokeObjectURL(this.src);
done(this);
}
}
else {
tag.src = loader.getItem().src;
if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
}
}
}
} else {
tag.src = loader.getItem().src;
}

if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
if (tag.complete) {
done(tag);
} else {
tag.onload = function () {
done(this);
}
}
}
};
Expand Down

0 comments on commit 9d9a4bf

Please sign in to comment.