From 54c3cc06876caebf3e7c3404c22c2b3e2c79e39c Mon Sep 17 00:00:00 2001 From: Ryan Clayton Date: Wed, 18 Sep 2024 15:41:09 -0600 Subject: [PATCH] Revert "MWPW-157888 - Hero marquee w/ `no-min-height` and no l/r padding when using a `full-width` variant" (#2905) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "MWPW-157888 - Hero marquee w/ `no-min-height` and no l/r padding when…" This reverts commit eb788ce7f1cb5288665e9af3843f2f8c48a74ef9. --- libs/blocks/hero-marquee/hero-marquee.css | 1 - libs/blocks/hero-marquee/hero-marquee.js | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/blocks/hero-marquee/hero-marquee.css b/libs/blocks/hero-marquee/hero-marquee.css index 94422024ed..34c9175a3f 100644 --- a/libs/blocks/hero-marquee/hero-marquee.css +++ b/libs/blocks/hero-marquee/hero-marquee.css @@ -17,7 +17,6 @@ align-items: center; } -.hero-marquee.no-min-height { min-height: unset; } .hero-marquee.s-min-height { min-height: var(--s-min-height); } .hero-marquee.l-min-height { min-height: var(--l-min-height); } diff --git a/libs/blocks/hero-marquee/hero-marquee.js b/libs/blocks/hero-marquee/hero-marquee.js index 04a8b57a21..91a0499e68 100644 --- a/libs/blocks/hero-marquee/hero-marquee.js +++ b/libs/blocks/hero-marquee/hero-marquee.js @@ -164,16 +164,14 @@ function loadBreakpointThemes() { export default async function init(el) { el.classList.add('con-block'); let rows = el.querySelectorAll(':scope > div'); - if (rows.length <= 1) return; - const [head, ...tail] = rows; - rows = tail; - if (head.textContent.trim() === '') { - head.remove(); - } else { + if (rows.length > 1 && rows[0].textContent !== '') { el.classList.add('has-bg'); + const [head, ...tail] = rows; handleObjectFit(head); decorateBlockBg(el, head, { useHandleFocalpoint: true }); + rows = tail; } + // get first row that's not a keyword key/value row const mainRowIndex = rows.findIndex((row) => { const firstColText = row.children[0].textContent.toLowerCase().trim();