1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-27 11:22:06 +02:00

fix: disable title attribute on menu items (#4019)

Prevents a title attribute from being applied to MenuItems.
MenuItem indicates to ClickableComponent that the control is not just an icon, so it shouldn't have a title attribute.

Fixes #3699
This commit is contained in:
Owen Edwards 2017-02-02 11:45:39 -08:00 committed by Gary Katsevman
parent 29c6141de9
commit 04f23c1a62
2 changed files with 7 additions and 1 deletions

View File

@ -121,7 +121,10 @@ class ClickableComponent extends Component {
this.controlText_ = text;
this.controlTextEl_.innerHTML = localizedText;
el.setAttribute('title', localizedText);
if (!this.nonIconControl) {
// Set title attribute if only an icon is shown
el.setAttribute('title', localizedText);
}
}
/**

View File

@ -54,6 +54,9 @@ class MenuItem extends ClickableComponent {
* The element that gets created.
*/
createEl(type, props, attrs) {
// The control is textual, not just an icon
this.nonIconControl = true;
return super.createEl('li', assign({
className: 'vjs-menu-item',
innerHTML: this.localize(this.options_.label),