From 9ad4e59d6f40b94d04a918e7560e7f5c33903655 Mon Sep 17 00:00:00 2001 From: Amogh Date: Mon, 28 Oct 2024 15:48:15 -0400 Subject: [PATCH] Update quote.js --- blocks/quote/quote.js | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/blocks/quote/quote.js b/blocks/quote/quote.js index 99629fc..8b13789 100644 --- a/blocks/quote/quote.js +++ b/blocks/quote/quote.js @@ -1,24 +1 @@ -import { createOptimizedPicture } from '../../scripts/aem.js'; -import { moveInstrumentation } from '../../scripts/scripts.js'; -export default function decorate(block) { - /* change to ul, li */ - const ul = document.createElement('ul'); - [...block.children].forEach((row) => { - const li = document.createElement('li'); - moveInstrumentation(row, li); - while (row.firstElementChild) li.append(row.firstElementChild); - [...li.children].forEach((div) => { - if (div.children.length === 1 && div.querySelector('picture')) div.className = 'cards-card-image'; - else div.className = 'cards-card-body'; - }); - ul.append(li); - }); - ul.querySelectorAll('picture > img').forEach((img) => { - const optimizedPic = createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }]); - moveInstrumentation(img, optimizedPic.querySelector('img')); - img.closest('picture').replaceWith(optimizedPic); - }); - block.textContent = ''; - block.append(ul); -}