From bf226e4174d269438d8c77130187274618e54c92 Mon Sep 17 00:00:00 2001 From: Steve Hanlon Date: Mon, 27 Jul 2026 08:37:07 +0100 Subject: [PATCH] =?UTF-8?q?Release=200.1.6=20=E2=80=94=20fix=20AJAX=20step?= =?UTF-8?q?-save=20listeners=20never=20attaching=20(hc-5yy)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 0.1.5 auto-save never fired: the inline ; function statusLabel(s) { return s.replace(/_/g, ' '); } + // These assets are emitted before the step cards in the markup, so the + // forms don't exist yet when this inline script first runs. Wait for the + // DOM before wiring listeners. + function ready(fn) { + if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', fn); } + else { fn(); } + } + ready(function () { document.querySelectorAll('form.att-hc-step-save').forEach(function (form) { var stepId = form.dataset.step; var select = form.querySelector('select[name="status"]'); @@ -519,6 +534,7 @@ function att_hc_print_step_save_assets(ATT_HC_Session $session): void { save(notes); }); }); + }); })();