DynamicMenu

DynamicMenu

new DynamicMenu()

Methods

clear(selector) → {Promise.<boolean>}

Removes matched elements from the DOM

Parameters:
Name Type Description
selector

selector to be searched for within the menu container. Typically set in handlebar template when rendering. Could be useful if the dynamic menu contains a mix of pre-defined commands as well as dynamic ones.

Returns:
Type
Promise.<boolean>

fetch() → {*|Promise}

Uses href parameter to invoke ajax call to the server

Returns:
Type
* | Promise

getMenuContainer()

Returns container for dynamic content, (commands/ menus)

getSettings() → {any|*}

Returns settings that were configured on the server for this menu

Returns:
Type
any | *

hasId(id) → {boolean}

Returns true if the menu's id matches the one requested for

Parameters:
Name Type Description
id

menu id to be matched

Returns:
Type
boolean

refresh() → {Promise.<any>}

API to re-render the menu content.

Returns:
Type
Promise.<any>

render(response)

Renders data received from server on the template

Parameters:
Name Type Description
response

JSON response from server