diff --git a/blocks/cards/support-contact-us-page.css b/blocks/cards/support-contact-us-page.css index a4e20ecda..4dc68cff0 100644 --- a/blocks/cards/support-contact-us-page.css +++ b/blocks/cards/support-contact-us-page.css @@ -166,12 +166,22 @@ object-fit: fill; } +.section.contact-us-card-wrapper .cards-wrapper .cards ul li .cards-card-body>p:last-child:has(span img){ + display: block; + width: 80px; + height: 80px; +} + .section.contact-us-card-wrapper .cards-wrapper .cards ul li .cards-card-body>p:has(span img):last-child span img { width: 80px; height: 80px; display: block; background-size: contain; object-fit: fill; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); } @media screen and (min-width:768px) and (max-width:1200px) { @@ -199,6 +209,10 @@ align-self: center; } + .section.contact-us-card-wrapper .cards-wrapper .cards ul li .cards-card-body>p:last-child:has(span img) { + display: none; + } + .section.contact-us-card-wrapper .cards-wrapper .cards ul li .cards-card-body>p span img { width: 40px; height: 40px; diff --git a/blocks/teaser/teaser.js b/blocks/teaser/teaser.js index f51169282..63ed877e8 100644 --- a/blocks/teaser/teaser.js +++ b/blocks/teaser/teaser.js @@ -1,7 +1,7 @@ import { applyLoanNow, bannerClick, ctaClickInteraction, readMoreInteraction, } from '../../dl.js'; -import { targetObject } from '../../scripts/scripts.js'; +import { targetObject , handleOpenFormOnClick } from '../../scripts/scripts.js'; export function decorateButtons(...buttons) { return buttons @@ -76,28 +76,28 @@ export function generateTeaserDOM(props, classes) {
${imageText.innerText}
${imageText2.innerText}
${imageText3.innerText}
@@ -126,6 +126,10 @@ export function generateTeaserDOM(props, classes) { if (index || e.target.closest('.cta')) { bannerClick(e.target.innerText, targetObject.pageName); } + if (e.target.closest('.open-form-on-click')) { + const formClickSection = e.target.closest('.open-form-on-click'); + handleOpenFormOnClick(formClickSection); + } } else if (this.closest('.carousel-articles-wrapper')) { readMoreAnalytics(e); } else if (this.closest('.csr-committee-wrapper')) { diff --git a/scripts/scripts.js b/scripts/scripts.js index 44a35aa01..03ebfb0b8 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -662,6 +662,7 @@ export async function decorateMain(main) { decorateSections(main); decorateBlocks(main); decorateImageIcons(main); + handleOpenFormOnClick(main); } /** @@ -1048,44 +1049,45 @@ export function showingStateCity(searchInputAll) { handleNeeyatClick(); }, 5000); */ -window.addEventListener("load", () => { - // Initialize IntersectionObserver - const observer = new IntersectionObserver((entries, observer) => { - entries.forEach(entry => { - if (entry.isIntersecting) { - if (entry.target.classList.contains("open-form-on-click")) { - handleOpenFormOnClick(); - } else if (entry.target.classList.contains("neeyat-click")) { - handleNeeyatClick(entry.target); - } - observer.unobserve(entry.target); - } - }); - }, { rootMargin: "50px" }); - - // Observe elements - Fixed version - const formSections = document.querySelectorAll('.open-form-on-click'); - const neeyatSections = document.querySelectorAll('.neeyat-click'); - - // Handle formSections - if (formSections.length > 0) { - formSections.forEach(section => { - observer.observe(section); - }); - } - - // Handle neeyatSections - if (neeyatSections.length > 0) { - neeyatSections.forEach(section => { - observer.observe(section); - }); - } -}); - - -function handleOpenFormOnClick() { - const formButtons = document.querySelectorAll('.open-form-on-click .button-container'); +// window.addEventListener("load", () => { +// // Initialize IntersectionObserver +// const observer = new IntersectionObserver((entries, observer) => { +// entries.forEach(entry => { +// if (entry.isIntersecting) { +// if (entry.target.classList.contains("open-form-on-click")) { +// handleOpenFormOnClick(); +// } else if (entry.target.classList.contains("neeyat-click")) { +// handleNeeyatClick(entry.target); +// } +// observer.unobserve(entry.target); +// } +// }); +// }, { rootMargin: "50px" }); + +// // Observe elements - Fixed version +// const formSections = document.querySelectorAll('.open-form-on-click'); +// const neeyatSections = document.querySelectorAll('.neeyat-click'); + +// // Handle formSections +// if (formSections.length > 0) { +// formSections.forEach(section => { +// observer.observe(section); +// }); +// } + +// // Handle neeyatSections +// if (neeyatSections.length > 0) { +// neeyatSections.forEach(section => { +// observer.observe(section); +// }); +// } +// }); + + +export function handleOpenFormOnClick(el) { + const formButtons = el.querySelectorAll('.open-form-on-click .button-container'); formButtons.forEach(button => { + console.log(button); button.addEventListener('click', onCLickApplyFormOpen); }); }