|
@@ -507,16 +507,21 @@ this.singlefile.lib.core = this.singlefile.lib.core || (() => {
|
|
|
if (attributeValue) {
|
|
if (attributeValue) {
|
|
|
const imageData = this.options.images[Number(attributeValue)];
|
|
const imageData = this.options.images[Number(attributeValue)];
|
|
|
if (imageData) {
|
|
if (imageData) {
|
|
|
- if (this.options.removeHiddenElements && imageData.size && !imageData.size.pxWidth && !imageData.size.pxHeight) {
|
|
|
|
|
|
|
+ if (this.options.removeHiddenElements && (
|
|
|
|
|
+ (imageData.size && !imageData.size.pxWidth && !imageData.size.pxHeight) ||
|
|
|
|
|
+ (imgElement.getAttribute(util.HIDDEN_CONTENT_ATTRIBUTE_NAME) == "")
|
|
|
|
|
+ )) {
|
|
|
imgElement.setAttribute("src", EMPTY_IMAGE);
|
|
imgElement.setAttribute("src", EMPTY_IMAGE);
|
|
|
- } else if (imageData.currentSrc) {
|
|
|
|
|
- imgElement.setAttribute("src", imageData.currentSrc);
|
|
|
|
|
- }
|
|
|
|
|
- if (this.options.loadDeferredImages) {
|
|
|
|
|
- if ((!imgElement.getAttribute("src") || imgElement.getAttribute("src") == EMPTY_IMAGE) && imgElement.getAttribute("data-src")) {
|
|
|
|
|
- imageData.src = imgElement.dataset.src;
|
|
|
|
|
- imgElement.setAttribute("src", imgElement.dataset.src);
|
|
|
|
|
- imgElement.removeAttribute("data-src");
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (imageData.currentSrc) {
|
|
|
|
|
+ imgElement.setAttribute("src", imageData.currentSrc);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.options.loadDeferredImages) {
|
|
|
|
|
+ if ((!imgElement.getAttribute("src") || imgElement.getAttribute("src") == EMPTY_IMAGE) && imgElement.getAttribute("data-src")) {
|
|
|
|
|
+ imageData.src = imgElement.dataset.src;
|
|
|
|
|
+ imgElement.setAttribute("src", imgElement.dataset.src);
|
|
|
|
|
+ imgElement.removeAttribute("data-src");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|