Skip to content

Commit

Permalink
feat: add a controlText function to MenuButton (#4125)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored and gkatsev committed Feb 22, 2017
1 parent 576ac19 commit 4388bea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/js/menu/menu-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ class MenuButton extends Component {
return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;
}

/**
* Get or set the localized control text that will be used for accessibility.
*
* > NOTE: This will come from the internal `menuButton_` element.
*
* @param {string} [text]
* Control text for element.
*
* @param {Element} [el=this.menuButton_.el()]
* Element to set the title on.
*
* @return {string}
* - The control text when getting
*/
controlText(text, el = this.menuButton_.el()) {
return this.menuButton_.controlText(text, el);
}

/**
* Handle a click on a `MenuButton`.
* See {@link ClickableComponent#handleClick} for instances where this is called.
Expand Down

0 comments on commit 4388bea

Please sign in to comment.