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

Commit

Permalink
small update
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Jun 21, 2014
1 parent 1fe24d0 commit de38cf3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion jquery.BlackAndWhite.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,20 @@
}
};
this.init = function(options) {

// convert all the images
$container.each(function(index, tmpImageWrapper) {
var $imageWrapper = $(tmpImageWrapper),
$img = $imageWrapper.find('img');

if ($img.data('_b&w')) return;
if (!$img[0].complete || (typeof $img[0].naturalWidth !== "undefined" && !$img[0].naturalWidth)) {
$img.on('load', function() {
_injectTags($img, $imageWrapper);
}).load();
} else {
_injectTags($img, $imageWrapper);
}
$img.data('_b&w', true);
});
// start the webworker
if (BnWWorker) {
Expand Down
4 changes: 3 additions & 1 deletion src/jquery.BlackAndWhite.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,20 @@
}
};
this.init = function(options) {

// convert all the images
$container.each(function(index, tmpImageWrapper) {
var $imageWrapper = $(tmpImageWrapper),
$img = $imageWrapper.find('img');

if ($img.data('_b&w')) return;
if (!$img[0].complete || (typeof $img[0].naturalWidth !== "undefined" && !$img[0].naturalWidth)) {
$img.on('load', function() {
_injectTags($img, $imageWrapper);
}).load();
} else {
_injectTags($img, $imageWrapper);
}
$img.data('_b&w', true);
});
// start the webworker
if (BnWWorker) {
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 de38cf3

Please sign in to comment.