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

Commit a7e9af6

Browse files
small bugfix
1 parent 4dbd51b commit a7e9af6

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

jquery.BlackAndWhite.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,14 @@
315315
// if this image is not loaded yet
316316
if (!_isImageLoaded($img[0])) {
317317
$img.on('load', function () {
318-
if (!_isImageLoaded($img[0])) {
318+
if ($img.data('_b&w_loaded') || !$img[0].complete) {
319319
setTimeout(function () {
320320
$img.load();
321321
}, 20);
322322
return;
323323
}
324324
_injectTags($img, $imageWrapper);
325+
$img.data('_b&w_loaded', true);
325326
imagesToLoadlength--;
326327
_initWebworker(imagesToLoadlength);
327328
}).load();

src/jquery.BlackAndWhite.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,14 @@
315315
// if this image is not loaded yet
316316
if (!_isImageLoaded($img[0])) {
317317
$img.on('load', function () {
318-
if (!_isImageLoaded($img[0])) {
318+
if ($img.data('_b&w_loaded') || !$img[0].complete) {
319319
setTimeout(function () {
320320
$img.load();
321321
}, 20);
322322
return;
323323
}
324324
_injectTags($img, $imageWrapper);
325+
$img.data('_b&w_loaded', true);
325326
imagesToLoadlength--;
326327
_initWebworker(imagesToLoadlength);
327328
}).load();

src/jquery.BlackAndWhite.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)