Load TOC after document ready (DOM Load)

Created on 22 July 2022, over 2 years ago
Updated 16 August 2024, 4 months ago

Problem/Motivation

When the page loads, the TOC block is created, but it is empty and contains no title.

Steps to reproduce

Access the page with placed and correctly configured TOC block. It is empty.
Only in rare cases when swapping between pages and accessing again the page on which the TOC is placed the titles appear.

Proposed resolution

The problem is that the content on the page and the blocks from which the titles are taken for the TOC block load later than the block itself, i.e. when the block loads it has nowhere to take the titles.

The solution is to use $(document).ready(), to detect when the page is loaded. Only after then run the toc.js functionality.

Remaining tasks

Write/rewrite a proper patch that will handle this particular case.

User interface changes

The TOC data will appear.

API changes

No.

Data model changes

No.

🐛 Bug report
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

🇲🇩Moldova nina_jeq

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024