Description

Menu panel is a DOM elements that shows a list of links. This menu panel is drawn dynamically by creating all menu elements programmatically upon calling menuObj.render(). The parent instantiating the menu will call render. Parent must then add the returned menu to DOM tree to display it to user.

Details

Classes


Members


<static> name

Description

name of this menu view

Returns
Details

<static> idAttr

Description

DOM attribute for getting the unique id of a link

Returns
Details

Description

Function that menu will call to get all links. This function is specified at instantiation.

Returns
Details

<private, static> getRecent

Description

Function that menu will call to get recent items. This function is specified at instantiation.

Returns
Details

<private, static> onPinToggle

Description

Callback function when item is pinned or unpinned. This callback is specified at instantiation.

Returns
Details

<private, static> onPinOrderChange

Description

Callback function when pin order is changed. This callback is specified at instantiation.

Returns
Details

Methods


<static> render()

Description

Programmatically draws the menu panel and its links

Returns
  • DOM element representing the menu.
Details

Description

When user has some pinned items, render each and make them draggable

Parameters
Name Type Description
panel Element

DOM element where links will be appended

Details

<private, static> renderRecentItems( panel )

Description

If user has recently clicked on some unpinned link, render them in this special section. Recent items will expire after enough time has elapsed since user clicked on the link.

Parameters
Name Type Description
panel Element

DOM element where links will be appended

Details

Description

The unpinned items will be displayed in alphabetical order (localized)

Parameters
Name Type Description
panel Element

DOM element where links will be appended

Details

<private, static> attachClickActions( element )

Description

bind the onclick events to a link

Parameters
Name Type Description
element Element

DOM node representing a link

Details

Description

Create link element that can be pinned

Parameters
Name Type Description
icon String

icon HTML as string

label String

link text

name String

className

Returns
  • created link element
Details

Description

Create and append an unpinned link

Parameters
Name Type Description
panel Element

DOM node where to append link

label String

link text

name String

className

Returns
Details