Skip to content

Add Load State to TOC Accordion for Delayed or Deferred JS#63

Merged
mtoensing merged 2 commits into
mtoensing:masterfrom
blronaldhuereca:fix/accordion-fix-js-delay
Nov 20, 2024
Merged

Add Load State to TOC Accordion for Delayed or Deferred JS#63
mtoensing merged 2 commits into
mtoensing:masterfrom
blronaldhuereca:fix/accordion-fix-js-delay

Conversation

@blronaldhuereca
Copy link
Copy Markdown
Contributor

Fixes #62

This PR introduces a check that checks if the DOM has already been loaded. If it has, it loads the TOC accordion as normal.

If the document hasn't already been loaded, then the DOMContentLoaded event is used to load the TOC.

@mtoensing
Copy link
Copy Markdown
Owner

Thanks. I need to test this in the coming days. Last time I merged something related to the js code it broke everything. =D

@mtoensing mtoensing merged commit 6cd4ad6 into mtoensing:master Nov 20, 2024
@blronaldhuereca
Copy link
Copy Markdown
Contributor Author

@mtoensing thank you. Please let me know if there's any help in testing you need.

We have modified your plugin temporarily, but you can see it working here with our Cookie/script settings implemented: https://www.boundless.com/immigration-resources/marriage-based-green-cards-explained/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Accordion events never triggered due to DOMContentLoaded never being called

2 participants