Skip to content

Commit

Permalink
Update quote.js
Browse files Browse the repository at this point in the history
  • Loading branch information
amoghdaryapurkar authored Oct 28, 2024
1 parent cab44bc commit 9ad4e59
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions blocks/quote/quote.js
Original file line number Diff line number Diff line change
@@ -1,24 +1 @@
import { createOptimizedPicture } from '../../scripts/aem.js';
import { moveInstrumentation } from '../../scripts/scripts.js';

Check failure on line 1 in blocks/quote/quote.js

View workflow job for this annotation

GitHub Actions / build

Too many blank lines at the beginning of file. Max of 0 allowed
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);
}

0 comments on commit 9ad4e59

Please sign in to comment.