Skip to content

Commit

Permalink
fix: remove title attribute on menu items, fixes #3699 (#4009)
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenEdwards authored and gkatsev committed Feb 7, 2017
1 parent daad492 commit 91874a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/css/video-js.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "private-variables";
@import "utilities";

@import "node_modules/videojs-font/scss/icons";
@import "../../node_modules/videojs-font/scss/icons";

@import "components/layout";
@import "components/big-play";
Expand Down
6 changes: 5 additions & 1 deletion src/js/clickable-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ 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);
}

return this;
}
Expand Down
3 changes: 3 additions & 0 deletions src/js/menu/menu-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 91874a3

Please sign in to comment.