new submenuContainer()
- Source:
Methods
(static) this.addEntry(value, action, addInFront, clickable, hoverable) → {object}
Add an entry to the submenu
Parameters:
Name | Type | Description |
---|---|---|
value |
object | string | the entry to add |
action |
function | function to execute when selected |
addInFront |
boolean | if the element shuld be added in front of all others |
clickable |
boolean | if the element triggers a close of the container |
hoverable |
boolean | if the element can be highlighted |
- Source:
Returns:
the entry that has been created
- Type
- object
(static) this.addInputValueElement(label, element) → {object}
Create a submenu element with a label and an input field
The element has the following structure:
{ type: {documentExportFormats} // type of the entry. Should be INPUT, PASSWORD or COLOR optionName: {string|function}, // name of the option, function has to return string defaultValue: {string}, // default value from `list` }
Parameters:
Name | Type | Description |
---|---|---|
label |
string | the label of the element |
element |
object | the input field type |
- Source:
Returns:
the created entry
- Type
- object
(static) this.addSubmenuSelector(label, staticContent) → {object}
Create a submenu selector. Requires a SubmenuContainer as entry point.
The staticContent object has the following structure:
{ type: {documentExportFormats} // type of the entry. Should be SUBMENU optionName: {string|function}, // name of the option, function has to return string defaultValue: {string}, // default value from `list` list: {array}, // array of objects action: {function} // the action to execute on click of an entry }the `list` contains objects in the following form:
{ name: {string}, // the unique name value: {string} // an optional custom value }
Parameters:
Name | Type | Description |
---|---|---|
label |
string | the label |
staticContent |
object | the content object |
- Source:
Returns:
the Entry
- Type
- object
(static) this.clear()
clears the whole list
- Source:
(static) this.finishClose()
Event to finish closing the submenu
- Source:
(static) this.getEntry(entryNr) → {object}
returns an entry by its number
Parameters:
Name | Type | Description |
---|---|---|
entryNr |
number | the entry number |
- Source:
Returns:
the element
- Type
- object
(static) this.getIndex(entry) → {number}
Finds the index of an entry
Parameters:
Name | Type | Description |
---|---|---|
entry |
object | the object to look for |
- Source:
Returns:
the index
- Type
- number
(static) this.numberOfEntries() → {number}
the amount of entries in the list
- Source:
Returns:
the amount of entries
- Type
- number
(static) this.removeEntry(entryNr) → {object|null}
Remove an entry by its position
Parameters:
Name | Type | Description |
---|---|---|
entryNr |
object | number | either the elment number or the object |
- Source:
Returns:
the object if it has been removed
- Type
- object | null
(static) this.show(visible)
Open the submenu
Parameters:
Name | Type | Description |
---|---|---|
visible |
boolean | true to show the subemnu |
- Source:
(static) this.triggerClose()
Trigger closing the submenu
- Source: