MenubarItem

MenubarItem

A basic navigation link contained inside of a Menubar.

Constructor

Description:
  • Constructs the menu item.

Source:
Parameters:
Name Type Description
options object

The options for generating the menu item.

Properties
Name Type Attributes Default Description
menuItemElement HTMLElement

The menu item in the DOM.

menuLinkElement HTMLElement

The menu item's link in the DOM.

parentMenu Menubar

The parent menu.

isSubmenuItem boolean <optional>
false

A flag to mark if the menu item is controlling a submenu.

childMenu Menubar | null <optional>
null

The child menu.

toggle MenubarToggle | null <optional>
null

The controller for the child menu.

initialize boolean <optional>
true

A flag to initialize the menu item immediately upon creation.

Extends

Members

(protected) _dom :Object.<HTMLElement>

Description:
  • The DOM elements within the menu item.

Source:
Overrides:
Properties:
Name Type Description
item HTMLElement

The menu item.

link HTMLElement

The menu item's link.

The DOM elements within the menu item.

Type:
  • Object.<HTMLElement>

(protected) _elements :Object.<BaseMenu, BaseMenuToggle>

Description:
  • The declared accessible-menu elements within the menu item.

Source:
Overrides:
Properties:
Name Type Attributes Description
parentMenu BaseMenu

The menu containing this menu item.

childMenu BaseMenu <nullable>

The menu contained within this menu item.

toggle BaseMenuToggle <nullable>

The menu toggle within this menu item that controls the childMenu.

The declared accessible-menu elements within the menu item.

Type:

_submenu :boolean

Description:
  • A flag marking a submenu item.

Source:
Overrides:

A flag marking a submenu item.

Type:
  • boolean

(readonly) dom :Object.<HTMLElement>

Description:
  • The DOM elements within the menu item.

Source:
Overrides:
See:
  • _dom

The DOM elements within the menu item.

Type:
  • Object.<HTMLElement>

(readonly) elements :Object.<BaseMenu, BaseMenuToggle>

Description:
  • The declared accessible-menu elements within the menu item.

Source:
Overrides:
See:
  • _elements

The declared accessible-menu elements within the menu item.

Type:

(readonly) isSubmenuItem :boolean

Description:
  • A flag marking a submenu item.

Source:
Overrides:
See:
  • _submenu

A flag marking a submenu item.

Type:
  • boolean

Methods

initialize()

Description:
  • Initialize the menu item.

    Initialize will call the BaseMenuItem's initialize method as well as set the menu item's role to "none", the menu link's role to "menuitem", and the menu link's tabIndex to -1 in the DOM.

Source:
Overrides:

focus()

Description:
  • Focuses the menu item's link if the parent menu's shouldFocus value is true.

    This will call the BaseMenuItem's focus method as well as set the menu link's tabIndex to 0 if the parent menu is the root menu.

Source:
Overrides:

blur()

Description:
  • Blurs the menu item's link if the parent menu's shouldFocus value is true.

    This will call the BaseMenuItem's blur method as well as set the menu link's tabIndex to -1 if the parent menu is the root menu.

Source:
Overrides: