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 <noreply@anthropic.com>
This commit is contained in:
Alejandro Veras
2026-10-19 12:34:48 -04:00
parent 27c0189f2b
commit daf95278a7
3 changed files with 10 additions and 5 deletions
+7 -2
View File
@@ -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) {