Constructor
new TOCView()
- Source:
Extends
Methods
appendLink(link, index)
appendLink - Adds the generated link to both the desktop and mobile TOCs
Parameters:
Name |
Type |
Description |
link |
HTMLLIElement
|
The top-level item to add, including second-level UL if present |
index |
number
|
The index of the top-level item |
- Source:
onClose()
onClose - Close and destroy the view
- Source:
addScrollspy - Adds and refreshes bootstrap's scrollSpy functionality,
and sets the listener to call this view's scrollSpyExtras when
Bootstrap's "activate" event is called. This function should be called
anytime the DOM is updated.
- Source:
scrollSpyExtras - Adds extra functionality to Bootstrap's scrollSpy function.
This function is called anytime the "activate" event is called by bootstrap.
For the desktop TOC, if activates the parent LI in the case that a second-level
LI is active. For the mobile TOC, it changes text displayed in this.topLevelMobileToggle
and this.secondLevelMobileToggle to the active top-level and second-level item, respectively.
It also makes only the active second-level menu visible under the secondLevelMobile dropdown.
Parameters:
Name |
Type |
Description |
e |
event
|
The "activate" event triggered when an LI element is activated by bootstrap's ScrollSpy |
- Source:
setAffix()
Adds and refreshes bootstrap's affix functionality. This function
should be called after the DOM has been rendered or updated. Renamed
from postRender to avoid it being called automatically by Backbone.
- Since:
- Source:
toggleDropdown(e)
toggleDropdown - Extends bootstrap's dropdown menu functionality by
hiding the dropdown menu when the user clicks the dropdown toggle or
any of the options within the dropdown menu.
Parameters:
Name |
Type |
Description |
e |
event
|
The click event on any part of the dropdown element |
- Source: