Guard DOT intake script — skip on non-DOT pages
Wraps entire script in element existence check to prevent running on FCC pages where other step scripts crash from missing elements. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
989ccaec93
commit
db96af53bf
1 changed files with 7 additions and 0 deletions
|
|
@ -252,6 +252,11 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
// Guard: only run on pages that have the DOT intake step
|
||||
if (!document.querySelector('[data-slug="dot-intake"], [data-step="dot-intake"]')) {
|
||||
// Not a DOT intake page — skip all initialization
|
||||
} else {
|
||||
|
||||
// Determine which sections to show based on services in the batch
|
||||
const DOT_SECTIONS: Record<string, string[]> = {
|
||||
"mcs150-update": ["dot-sec-operations","dot-sec-fleet","dot-sec-cargo","dot-sec-photo-id"],
|
||||
|
|
@ -416,4 +421,6 @@
|
|||
if (idPreview) idPreview.hidden = true;
|
||||
if (idBtn) idBtn.style.display = "flex";
|
||||
});
|
||||
|
||||
} // end guard
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue