Expand all

ve.ui.MWTocWidget

Extends

Constructor

new ve.ui.MWTocWidget(surface, [config]) #

Creates a ve.ui.MWTocWidget object.

Parameters:

Name Type Attributes Description
surface ve.ui.Surface
config Object optional

Configuration options

Source:
Creates a ve.ui.MWTocWidget object.

Methods

build() #

Build TOC from mwHeading dm nodes

Based on generateTOC in Linker.php

Source:

Build TOC from mwHeading dm nodes

Based on generateTOC in Linker.php

initFromMetaList() #

Initialize TOC based on the presence of magic words

Source:
Initialize TOC based on the presence of magic words

onMetaListInsert(metaItem) #

Bound to MetaList insert event to set TOC display options

Parameters:

Name Type Description
metaItem ve.dm.MetaItem
Source:
Bound to MetaList insert event to set TOC display options

onMetaListRemove(metaItem) #

Bound to MetaList insert event to set TOC display options

Parameters:

Name Type Description
metaItem ve.dm.MetaItem
Source:
Bound to MetaList insert event to set TOC display options

rebuild() #

Rebuild TOC on ve.ce.MWHeadingNode teardown or setup

Rebuilds on both teardown and setup of a node, so build is debounced

Source:

Rebuild TOC on ve.ce.MWHeadingNode teardown or setup

Rebuilds on both teardown and setup of a node, so build is debounced

updateNode(viewNode) #

Update the text content of a specific heading node

Parameters:

Name Type Description
viewNode ve.ce.MWHeadingNode

Heading node

Source:
Update the text content of a specific heading node

updateVisibility() #

Hides or shows the TOC based on page and default settings

Source:
Hides or shows the TOC based on page and default settings