Skip to content

Commit 0b5af0f

Browse files
MC-36202: Support same site
- add comments
1 parent a461025 commit 0b5af0f

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/observable-updater/attributes.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/utils/directives.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/observable-updater/attributes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export default function generate(
4141
value = converterPool.get(converter).toDom(attributeConfig.var, data);
4242
}
4343

44+
// Replacing src attribute with data-src to prevent img requests in iframe during master format rendering
4445
if (attributeConfig.name === "src" && Config.getMode() !== "Preview") {
4546
attributeData["data-" + attributeConfig.name] = value;
4647
} else {

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/utils/directives.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ export function convertMediaDirectivesToUrls(html: string): string {
132132
return html;
133133
}
134134

135+
/**
136+
* Replace data-src attribute with src.
137+
*
138+
* @param {string} html
139+
* @returns {string}
140+
*/
135141
export function replaceSrc(html: string): string {
136142
return html.replace(
137143
new RegExp("data-src=\"\{\{", "g"),

0 commit comments

Comments
 (0)