1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-10 12:08:14 +02:00

fix(menu-button): make menu button title a component (#5722)

Fixes #3612, fixes #5759
This commit is contained in:
chrisboustead 2019-01-18 14:56:58 -05:00 committed by Gary Katsevman
parent 4b11a4e2b5
commit 2f0834f43f

View File

@ -108,7 +108,7 @@ class MenuButton extends Component {
// Add a title list item to the top
if (this.options_.title) {
const title = Dom.createEl('li', {
const titleEl = Dom.createEl('li', {
className: 'vjs-menu-title',
innerHTML: toTitleCase(this.options_.title),
tabIndex: -1
@ -116,8 +116,9 @@ class MenuButton extends Component {
this.hideThreshold_ += 1;
menu.children_.unshift(title);
Dom.prependTo(title, menu.contentEl());
const titleComponent = new Component(this.player_, {el: titleEl});
menu.addItem(titleComponent);
}
this.items = this.createItems();