Skip to content

Commit

Permalink
MWPW-157682 Check CLS for photoshop page (#2860)
Browse files Browse the repository at this point in the history
* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

* eagerloading icons

---------

Co-authored-by: Suhani <[email protected]>
Co-authored-by: Suhani <[email protected]>
  • Loading branch information
3 people committed Sep 16, 2024
1 parent 13b62d5 commit 2ee8d3b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libs/blocks/hero-marquee/hero-marquee.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ function parseKeyString(str) {
return result;
}

function loadContentType(el, key, classes) {
async function loadContentType(el, key, classes) {
if (classes !== undefined && classes.length) el.classList.add(...classes);
switch (key) {
case 'bgcolor':
decorateBg(el);
break;
case 'lockup':
decorateLockupRow(el, classes);
await decorateLockupRow(el, classes);
break;
case 'qrcode':
decorateQr(el);
Expand Down Expand Up @@ -237,6 +237,7 @@ export default async function init(el) {
}
});

const promiseArr = [];
[...rows].forEach(async (row) => {
const cols = row.querySelectorAll(':scope > div');
const firstCol = cols[0];
Expand All @@ -248,12 +249,15 @@ export default async function init(el) {
firstCol.parentElement.classList.add(`row-${parsed.key}`, 'con-block');
firstCol.remove();
cols[1].classList.add('row-wrapper');
if (contentTypes.includes(parsed.key)) loadContentType(row, parsed.key, parsed.classes);
if (contentTypes.includes(parsed.key)) {
promiseArr.push(loadContentType(row, parsed.key, parsed.classes));
}
} else {
row.classList.add('norm');
decorateBlockHrs(row);
decorateButtons(row, 'button-xl');
}
});
decorateTextOverrides(el, ['-heading', '-body', '-detail'], mainCopy);
await Promise.all(promiseArr);
}

0 comments on commit 2ee8d3b

Please sign in to comment.