mirror of
https://github.com/videojs/video.js.git
synced 2025-02-08 12:05:47 +02:00
fix(menu-button): make menu button title a component (#5722)
Fixes #3612, fixes #5759
This commit is contained in:
parent
4b11a4e2b5
commit
2f0834f43f
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user