/* global _prepareAccordion */ //see utils.js (function ($) { // Customize the page TOC document.addEventListener('DOMContentLoaded', () => { this.pageToc = document.getElementById('o_page_toc'); // The tree of content of the page if (this.pageToc) { // The local toctree is not included for toctree pages (see layout.html) this.headingRefs = this.pageToc.querySelectorAll('a'); // The references to all headings // If the page TOC has less than 2 headings, in addition to the title, hide it entirely if (this.headingRefs.length <= 2) { _hidePageToc(); return; } // Allow to automatically collapse and expand TOC entries _prepareAccordion(this.pageToc); // Allow to respectively highlight and expand the TOC entries and their related TOC // entry list whose section is focused. _flagActiveTocEntriesAndLists(); // Allow to hide the TOC entry referring the title (

heading) _flagFirstHeadingRef(); } }); /** * Entirely hide the local tree of contents. */ const _hidePageToc = () => this.pageToc.style.display = 'none'; /** * Add the relevant classes on the TOC entries (and lists) whose section is focused. * * TOC entries whose section is focused (
  • elements) receive the `o_active_toc_entry` class * and their related TOC entry list (