Skip to content
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.

Commit

Permalink
small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jul 31, 2014
1 parent 4dbd51b commit a7e9af6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion jquery.BlackAndWhite.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@
// if this image is not loaded yet
if (!_isImageLoaded($img[0])) {
$img.on('load', function () {
if (!_isImageLoaded($img[0])) {
if ($img.data('_b&w_loaded') || !$img[0].complete) {
setTimeout(function () {
$img.load();
}, 20);
return;
}
_injectTags($img, $imageWrapper);
$img.data('_b&w_loaded', true);
imagesToLoadlength--;
_initWebworker(imagesToLoadlength);
}).load();
Expand Down
3 changes: 2 additions & 1 deletion src/jquery.BlackAndWhite.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,14 @@
// if this image is not loaded yet
if (!_isImageLoaded($img[0])) {
$img.on('load', function () {
if (!_isImageLoaded($img[0])) {
if ($img.data('_b&w_loaded') || !$img[0].complete) {
setTimeout(function () {
$img.load();
}, 20);
return;
}
_injectTags($img, $imageWrapper);
$img.data('_b&w_loaded', true);
imagesToLoadlength--;
_initWebworker(imagesToLoadlength);
}).load();
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.BlackAndWhite.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7e9af6

Please sign in to comment.