Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing the Table of Contents section with delay. #657

Open
ellietms opened this issue Nov 29, 2021 · 2 comments
Open

Seeing the Table of Contents section with delay. #657

ellietms opened this issue Nov 29, 2021 · 2 comments

Comments

@ellietms
Copy link

ellietms commented Nov 29, 2021

Hi, when we go to this page jsGuide, at first we see all the page contents at first and after a delay, we see the table of contents on the top of the page.

@ellietms ellietms changed the title Seeing the Table of Contents section after rendering content of the jsguide page. Seeing the Table of Contents section with delay. Nov 29, 2021
@Krish-bhardwaj
Copy link

Hi i am a fresher looking for some opensource contribution can u help me out i want to contribute to your project and can u assign me this issue:)

@Carrotman42
Copy link
Collaborator

The reason for this seems to be due to using the onload event: the jsguide.html has a <body onload="initStyleGuide();">, and function initStyleGuide (found in include/styleguide.js) contains a call to CreateTOC which dynamically builds the table of contents. Using onload causes the javascript to execute after the page has been fully loaded, as far as I can tell.

If someone wanted to find a way to avoid this, they'd have to somehow ensure the CreateTOC logic still works before the whole page is fully loaded; unfortunately, that code relies on (at least most of) the page being loaded to work, since it reads the DOM and creates the table of contents dynamically based on it.

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

No branches or pull requests

3 participants