Extends
Constructor
new ve.ui.MWTocWidget(surface, [config])
#
Hierarchy
Creates a ve.ui.MWTocWidget object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
surface |
ve.ui.Surface | ||
config |
Object |
optional |
Configuration options |
Creates a ve.ui.MWTocWidget object.
Methods
build()
#
Build TOC from mwHeading dm nodes
Based on generateTOC in Linker.php
Build TOC from mwHeading dm nodes
Based on generateTOC in Linker.php
initFromMetaList()
#
Initialize TOC based on the presence of magic words
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 |
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 |
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
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 |
Update the text content of a specific heading node
updateVisibility()
#
Hides or shows the TOC based on page and default settings
Hides or shows the TOC based on page and default settings