Class: shaka.ui.MenuGroup

Constructor

Parameters:
Name Type Description
parent HTMLElement
controls shaka.ui.Controls
icon shaka.extern.UIIcon | string
Implements:
Extends:
Source:

Extends

Members

namesInCreation_ :Array<string>

The names of the elements being created, from the outermost menu group to the innermost one.
Type:
  • Array<string>
Source:

backButton :HTMLButtonElement

Type:
  • HTMLButtonElement
Overrides:
Implements:
Source:

button :HTMLButtonElement

Type:
  • HTMLButtonElement
Overrides:
Implements:
Source:

childrenObserver_ :MutationObserver

Type:
  • MutationObserver
Source:

isChildMenuOpened_ :boolean

Whether a submenu of one of the elements in the group is open.
Type:
  • boolean
Source:

isInMenuGroup :boolean

True when the element is a child of a shaka.ui.MenuGroup.
Type:
  • boolean
Overrides:
Implements:
Source:

isMenuOpened_ :boolean

Type:
  • boolean
Overrides:
Source:
Type:
  • MutationObserver
Overrides:
Source:

mutationObserver_ :MutationObserver

Type:
  • MutationObserver
Overrides:
Source:

parent :HTMLElement

Type:
  • HTMLElement
Overrides:
Implements:
Source:

resizeObserver_ :ResizeObserver

Type:
  • ResizeObserver
Overrides:
Source:

resizeRafId_ :number

Type:
  • number
Overrides:
Source:

summarySpan_ :Element

The current selection span of the element given by getSummaryElementName().
Type:
  • Element
Source:

videoContainer_ :HTMLElement

Type:
  • HTMLElement
Overrides:
Source:

Methods

addButton_(iconText)

Parameters:
Name Type Description
iconText shaka.extern.UIIcon | string
Overrides:
Source:

adjustMenuStyle(menuElementnon-null, buttonElementnon-null, controlsContainernon-null)

Shared positioning algorithm used by both OverflowMenu and SettingsMenu. Computes: - maxHeight so the menu does not overflow the video container vertically. - left/right offset so the menu stays within the controls bar horizontally, aligned with the button that opened it.
Parameters:
Name Type Description
menuElement HTMLElement The floating menu div to position.
buttonElement HTMLElement The button that triggered the menu.
controlsContainer HTMLElement The bottom controls bar used as the horizontal reference.
Overrides:
Source:

createChildren_()

Source:

dispatchSubMenuEvent_(type)

Notifies the elements that share this submenu's container, so they hide or show their buttons. Other menu levels are not affected.
Parameters:
Name Type Description
type string
Overrides:
Source:

focusOnMenuOpen()

Moves the focus into the menu after it is opened.
Overrides:
Source:

getChildElementNames() → {Array<string>}

Returns the names of the elements inside the group, as registered with shaka.ui.OverflowMenu.registerElement.
Implements:
Source:
Returns:
Type
Array<string>

getName() → {string}

Returns the localized name of the group, shown on its button and as the title of its submenu.
Implements:
Source:
Returns:
Type
string

getShownChildren_() → {Array<!Element>}

Source:
Returns:
The elements in the group that are shown.
Type
Array<!Element>

getSummaryElementName() → {string}

Returns the name of the element, among getChildElementNames(), whose current selection is shown on the group button, or null to show none.
Implements:
Source:
Returns:
Type
string

shouldCloseOnMenuClick(eventnon-null) → {boolean}

Whether a click inside a submenu closes it and returns to its parent. By default any click does, since it usually chooses an item.
Parameters:
Name Type Description
event Event
Overrides:
Source:
Returns:
Type
boolean

update_()

Source: