Revert to one-by-one manual extraction of images

Former-commit-id: b8eeb644ee12aabbf1a88f946d74289b0e2109ae [formerly 6dcc64c24ebb88f510793adc4f0f97cac9f055cf [formerly a4b9d32372716058a6ab4dc40f85d852c2515ce2]]
Former-commit-id: 5963575cd7a5c2996b3399fa9338937d1a569ca6
Former-commit-id: f302d80e63ef5bc556b756dfb4ffdedb85dcdcab
This commit is contained in:
Jaifroid 2020-12-02 09:23:13 +00:00
parent bc2e6a1a40
commit 7fc696b30e

View File

@ -125,12 +125,18 @@ define(['uiUtil'], function (uiUtil) {
e.preventDefault();
e.stopPropagation();
}
var visibleImages = queueImages('poll', 0, function() { extractImages(visibleImages); }).visible;
visibleImages.forEach(function (image) {
image.style.opacity = '0';
if (image.dataset.kiwixheight) image.height = image.dataset.kiwixheight;
else image.removeAttribute('height');
});
// DEV: Algorithm below doesn't queue webp images correctly, so for now we will extract images
// only one-by-one on image click
// var visibleImages = queueImages('poll', 0, function() { extractImages(visibleImages); }).visible;
// visibleImages.forEach(function (image) {
// image.style.opacity = '0';
// if (image.dataset.kiwixheight) image.height = image.dataset.kiwixheight;
// else image.removeAttribute('height');
//});
extractImages([thisImage]);
thisImage.style.opacity = '0';
if (thisImage.dataset.kiwixheight) thisImage.height = thisImage.dataset.kiwixheight;
else thisImage.removeAttribute('height');
});
}
}