Skip to content

Commit eaf9e3d

Browse files
Goamanloco-odoo
authored andcommitted
update getImageSrc
1 parent 5440606 commit eaf9e3d

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

addons/html_editor/static/src/main/media/image_post_process_plugin.js

-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ export class ImagePostProcessPlugin extends Plugin {
1717
static id = "imagePostProcess";
1818
static dependencies = ["style"];
1919
static shared = ["processImage"];
20-
resources = {
21-
system_attributes: ["data-bg-src"],
22-
};
2320

2421
/**
2522
* Applies data-attributes modifications to an img tag and returns a dataURL

addons/html_editor/static/src/utils/image.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,7 @@ export function getImageSrc(el) {
9797
if (el.tagName === "IMG") {
9898
return el.getAttribute("src");
9999
}
100-
if (el.dataset.bgSrc && el.style.backgroundImage.includes(el.dataset.bgSrc)) {
101-
return el.dataset.bgSrc;
102-
}
103-
const url = backgroundImageCssToParts(getComputedStyle(el)["background-image"]).url;
104-
// Cache the this value as getComputedStyle can eat performance
105-
if (url) {
106-
el.dataset.bgSrc = url;
107-
} else {
108-
delete el.dataset.bgSrc;
109-
}
100+
const url = backgroundImageCssToParts(el.style.backgroundImage).url;
110101
return url && getBgImageURLFromURL(url);
111102
}
112103

0 commit comments

Comments
 (0)