toc

Table of contents singleton.

Source:

Classes

TocItem

Methods

(static) addCommentCount()

Source:

Add the number of comments to each section link.

(static) getBottomOffset() → {number}

Source:

Get the bottom offset of the table of contents.

Returns:
Type
number

(static) getItem(id) → (nullable) {module:toc~TocItem}

Source:

Get a TOC item by ID.

Parameters:
Name Type Description
id string
Returns:
Type
module:toc~TocItem

(static) init(subscriptions)

Source:

For internal use. Initialize the TOC. (Executed only once.)

Parameters:
Name Type Description
subscriptions Subscriptions

(static) isFloating() → {boolean}

Source:

Is the table of contents floating (it or its parent has a float CSS).

This should be called after the HTML content has been laid out.

Returns:
Type
boolean

(static) isPresent() → {boolean}

Source:

Is the table of contents present on the page.

Returns:
Type
boolean

(static) setup(sectionsopt, hideTocopt)

Source:

For internal use. Setup the TOC data and, for sidebar TOC, update its content. (Executed at every page load.)

Parameters:
Name Type Attributes Description
sections Array.<object> <optional>

TOC sections object.

hideToc boolean <optional>

Whether the TOC should be hidden.