Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hubspot iframe fix #1529

Merged
merged 7 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,10 @@ function addHreflangTags() {
*/
export function iframeResizeHandler(iframeURL, iframeID, root) {
loadScript('/scripts/iframeResizer.min.js');
root.querySelector('iframe').addEventListener('load', async () => {
root.querySelector('iframe').addEventListener('load', () => {
if (iframeURL) {
/* global iFrameResize */
iFrameResize({ log: false }, `#${iframeID}`);
iFrameResize({ log: false, checkOrigin: false, heightCalculationMethod: 'bodyScroll' }, `#${iframeID}`);
}
});
}
Expand Down
7 changes: 6 additions & 1 deletion templates/landing-page/landing-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ async function iframeResizeHandler() {
});

/* global iFrameResize */
iFrameResize({ log: false });
setTimeout(() => {
iFrameResize({
log: true,
}, '#iframeContent');
}, 1000);
}

function handleEmbed() {
Expand Down Expand Up @@ -42,6 +46,7 @@ function handleEmbed() {
if (record.target.tagName === 'IFRAME'
&& grandGrandParent.classList.contains('embed')
) {
// iframeResizeHandler(iframeURL, iframeID, root);
const { height } = record.target.style;
if (height) {
const parent = record.target.parentElement;
Expand Down