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

Commit de38cf3

Browse files
small update
1 parent 1fe24d0 commit de38cf3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

jquery.BlackAndWhite.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,20 @@
227227
}
228228
};
229229
this.init = function(options) {
230+
230231
// convert all the images
231232
$container.each(function(index, tmpImageWrapper) {
232233
var $imageWrapper = $(tmpImageWrapper),
233234
$img = $imageWrapper.find('img');
234-
235+
if ($img.data('_b&w')) return;
235236
if (!$img[0].complete || (typeof $img[0].naturalWidth !== "undefined" && !$img[0].naturalWidth)) {
236237
$img.on('load', function() {
237238
_injectTags($img, $imageWrapper);
238239
}).load();
239240
} else {
240241
_injectTags($img, $imageWrapper);
241242
}
243+
$img.data('_b&w', true);
242244
});
243245
// start the webworker
244246
if (BnWWorker) {

src/jquery.BlackAndWhite.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,20 @@
227227
}
228228
};
229229
this.init = function(options) {
230+
230231
// convert all the images
231232
$container.each(function(index, tmpImageWrapper) {
232233
var $imageWrapper = $(tmpImageWrapper),
233234
$img = $imageWrapper.find('img');
234-
235+
if ($img.data('_b&w')) return;
235236
if (!$img[0].complete || (typeof $img[0].naturalWidth !== "undefined" && !$img[0].naturalWidth)) {
236237
$img.on('load', function() {
237238
_injectTags($img, $imageWrapper);
238239
}).load();
239240
} else {
240241
_injectTags($img, $imageWrapper);
241242
}
243+
$img.data('_b&w', true);
242244
});
243245
// start the webworker
244246
if (BnWWorker) {

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)