From daf95278a79946007ed0448cc97a26d96b08dca5 Mon Sep 17 00:00:00 2001 From: Alejandro Veras Date: Mon, 19 Oct 2026 12:34:48 -0400 Subject: [PATCH] Fix booking calendars not growing, which hid the confirm button The gate loaded the calendar iframes after GHL's form_embed.js ran, so it never auto-sized them and the details step was cut off. The iframes keep their src again; book.js runs first and removes them when the page is locked. Co-Authored-By: Claude Opus 5.5 --- src/layout.mjs | 3 +-- src/pages/book.mjs | 3 ++- static/assets/book.js | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/layout.mjs b/src/layout.mjs index d5c4b05..3b68a63 100644 --- a/src/layout.mjs +++ b/src/layout.mjs @@ -279,6 +279,5 @@ ${scripts} export const GHL_SCRIPT = ''; export const ghlForm = (id, name) => ``; -// Calendars start without a src: book.js loads them once the visitor has sent the lead form. export const ghlCalendar = (id, title) => - ``; + ``; diff --git a/src/pages/book.mjs b/src/pages/book.mjs index 5f7afa1..f88a25f 100644 --- a/src/pages/book.mjs +++ b/src/pages/book.mjs @@ -34,7 +34,8 @@ export default { `, title: 'Book Your Call | Dylan Mazzei', description: 'Book a free 15-minute intro call with Dylan Mazzei’s team or a 15-minute 1:1 session with Dylan.', - scripts: GHL_SCRIPT + '\n', + // book.js before form_embed.js, so a locked page removes the calendars first. + scripts: '\n' + GHL_SCRIPT, body: `
diff --git a/static/assets/book.js b/static/assets/book.js index cd9345a..f9423ed 100644 --- a/static/assets/book.js +++ b/static/assets/book.js @@ -1,6 +1,11 @@ (function () { - if (document.documentElement.getAttribute('data-gate') !== 'open') return; - document.querySelectorAll('iframe[data-src]').forEach(function (f) { f.src = f.getAttribute('data-src'); }); + // Without the lead form, drop the calendars before GHL's form_embed.js picks them up. + // The iframes keep their src in the HTML: form_embed.js only sizes iframes that already + // point at /booking when it runs, and an unsized calendar hides its confirm button. + if (document.documentElement.getAttribute('data-gate') !== 'open') { + document.querySelectorAll('iframe.ghl-cal').forEach(function (f) { f.remove(); }); + return; + } var tabs = document.querySelectorAll('[data-call]'); var select = function (id, scroll) { tabs.forEach(function (t) {