Extras.Sync
Menu
Abstract
Class Hierarchy:
Direct Known Subclasses:
Extras.Sync.ContextMenu, Extras.Sync.DropDownMenu, Extras.Sync.MenuBarPane

Abstract base class for menu rendering peers.

Descendant Class Summary
Extras.Sync.Menu.RenderedMenu

Constructor Summary
Public Extras.Sync.Menu()

Class Field Summary
Public DEFAULT_FOREGROUND
Public DEFAULT_BACKGROUND
Public DEFAULT_DISABLED_FOREGROUND
Public DEFAULT_SELECTION_FOREGROUND
Public DEFAULT_SELECTION_BACKGROUND
Public DEFAULT_BORDER
Public MAX_Z_INDEX
Public menuModel
The root menu model.
Public stateModel
The menu state model.
Public element
The root DOM element of the rendered menu.
Public active
The active state of the menu, true when the menu is open.
Internal _openMenuPath
Array containing RenderedState objects for open menus.
Internal _maskDeployed
Flag indicating whether menu mask is deployed.
Internal _processMaskClickRef
Reference to the mask click listener.
Internal _processKeyPressRef
Reference to menu key press listener.
Internal _overlay
The collection of named overlay elements (top/left/right/bottom) deployed to cover non-menu elements of the screen with transparent DIVs when the menu is active.

Instance Method Summary
Public, Abstract getSubMenuPosition()
Returns an object containing 'x' and 'y' properties indicating the position at which a submenu should be placed.
Public, Abstract renderMain()
Renders the top level menu of the menu component (that which resides in the DOM at all times).
Public, Virtual activate()
Activates the menu component.
Public, Virtual activateItem()
Activates a menu item.
Public, Virtual processAction()
Fires an action event in response to a menu option being activated.
Public, Virtual processKeyPress()
Key press listener.
Public addMenu()
Public addMask()
Adds the menu mask, such that click events on elements other than the menu will be captured by the menu.
Public closeAll()
Closes all open menus.
Public closeDescendants()
Closes all open menus which are descendants of the specified parent menu.
Public deactivate()
Deactivates the menu component, closing any open menus.
Public isOpen()
Determines if the specified menu is currently open (on-screen).
Internal _overlayAdd()
Creates and adds the overlay mask elements to the screen, blocking all content except that within the specified bounds.
Internal _overlayRemove()
Removes the overlay mask from the screen, if present.
Internal _openMenu()
Opens a menu.
Internal _processMaskClick()
Handler for clicks on the overlay mask: de-activates menu.
Public removeMask()
Removes the menu mask.
Public renderAdd()
Public renderDispose()
Public renderUpdate()

Methods inherited from class Echo.Render.ComponentSync
renderAdd, renderDispose, renderUpdate

Constructor Detail
Echo.Render.ComponentSync()

Instance Method Detail
getSubMenuPosition
Returns an object containing 'x' and 'y' properties indicating the position at which a submenu should be placed.

renderMain
Renders the top level menu of the menu component (that which resides in the DOM at all times).
Parameters:
the (Echo.Update.ComponentUpdate) - hierarchy update for which the rendering is being performed

activate
Activates the menu component.

activateItem
Activates a menu item. Displays submenu if item is a submenu. Invokes menu action if item is a menu option.
Parameters:
itemModel (Extras.ItemModel) - the item model to activate.

processAction
Fires an action event in response to a menu option being activated.

processKeyPress
Key press listener.

addMenu

addMask
Adds the menu mask, such that click events on elements other than the menu will be captured by the menu.

closeAll
Closes all open menus.

closeDescendants
Closes all open menus which are descendants of the specified parent menu.
Parameters:
the (Extras.MenuModel) - parent menu

deactivate
Deactivates the menu component, closing any open menus.

isOpen
Determines if the specified menu is currently open (on-screen).
Parameters:
menuModel (Extras.MenuModel) - the menu
Returns:
(Boolean) true if the menu is open

_overlayAdd
Creates and adds the overlay mask elements to the screen, blocking all content except that within the specified bounds.
Parameters:
bounds - an object containing the pixel bounds of the region NOT to be blocked, must provide top, left, width, and height integer properties

_overlayRemove
Removes the overlay mask from the screen, if present.

_openMenu
Opens a menu.
Parameters:
menuModel (Extras.MenuModel) - the menu to open

_processMaskClick
Handler for clicks on the overlay mask: de-activates menu.

removeMask
Removes the menu mask.

renderAdd

renderDispose

renderUpdate