diff --git a/blocks/columns-small/columns-small.js b/blocks/columns-small/columns-small.js index 588ada45..d5e8cc9b 100644 --- a/blocks/columns-small/columns-small.js +++ b/blocks/columns-small/columns-small.js @@ -11,33 +11,33 @@ export default function decorate(block) { wrapImgsInLinks(col); if (!textOnlyColBlock) { const pics = col.querySelectorAll('picture'); - if (pics.length) { - const picWrapper = pics[0].closest('div'); - if (picWrapper && picWrapper.children.length === pics.length) { - // pictures (either wrapped in achors, or otherwise) - // are only content in the column - picWrapper.classList.add('columns-small-img-col'); - } - } + if (pics.length) { + const picWrapper = pics[0].closest('div'); + if (picWrapper && picWrapper.children.length === pics.length) { + // pictures (either wrapped in achors, or otherwise) + // are only content in the column + picWrapper.classList.add('columns-small-img-col'); + } + } } }); }); - // decorate columns-small with description content + // decorate columns-small with description content [...block.children].forEach((row) => { const cells = row.querySelectorAll('div:not(.columns-small-img-col)'); if (cells.length) { [...cells].forEach((content) => { - content.classList.add('description'); - const contentWrapper = document.createElement('div'); - contentWrapper.classList.add('description-wrapper'); - const contentParent = content.parentElement; - contentParent.insertBefore(contentWrapper, content); - contentWrapper.appendChild(content); - if (textOnlyColBlock) { - content.classList.add('text-only'); - } + content.classList.add('description'); + const contentWrapper = document.createElement('div'); + contentWrapper.classList.add('description-wrapper'); + const contentParent = content.parentElement; + contentParent.insertBefore(contentWrapper, content); + contentWrapper.appendChild(content); + if (textOnlyColBlock) { + content.classList.add('text-only'); + } }); } }); -} \ No newline at end of file +}