Constructor
new Sidebar(target)
Create sidebar and optionally append it to a target element.
{@code target} can be an "#id" with a hash in the beginning
or an instance of HTMLElement.
Parameters:
Name | Type | Description |
---|---|---|
target |
string/HTMLElement | id or HTMLElement (optional) |
- Source:
Methods
addGroup(name, title, classNames, content, position)
Adds a content group in the sidebar navigation
Parameters:
Name | Type | Default | Description |
---|---|---|---|
name |
string | identifier of the group | |
title |
string | headline of the group | |
classNames |
string | css classes separated by space | |
content |
string/HTMLElement | content as HTML-String or HTMLElement | |
position |
string | end | "begin" or "end" (default is end) |
- Source:
close()
Close the sidebar
- Source:
getGroupContainer(name) → {HTMLElement}
get container element of a content group
Parameters:
Name | Type | Description |
---|---|---|
name |
string | identifier of the group |
- Source:
Returns:
content container
- Type
- HTMLElement
getGroups()
Returns all defined groups.
- Source:
removeGroup(name)
Remove content group from the sidebar navigation
Parameters:
Name | Type | Description |
---|---|---|
name |
string | identifier of the group |
- Source:
setContent(name, content, keepScrollposition)
Update the content of a group with the given name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
content |
string | HTMLElement | |
keepScrollposition |
boolean |
- Source:
setTitle(name, title)
Update the title of a group wth the given name
Parameters:
Name | Type | Description |
---|---|---|
name |
string | |
title |
string |
- Source:
show(name)
Show the content of a group
Parameters:
Name | Type | Description |
---|---|---|
name |
string | identifier of the group |
- Source: