Skip to content

Commit

Permalink
fix(ie8): various minor ie8 fixes (#4175)
Browse files Browse the repository at this point in the history
This fixes a logging in the console regarding timetooltips which don't exist. Also, makes sure not to focus the menu button when the captions settings menu item is clicked since the caption settings is getting focused instead. In addition, it makes sure the legend text in the track settings is the foreground color.
  • Loading branch information
gkatsev authored Mar 7, 2017
1 parent 1770f00 commit cb890a9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/css/components/_captions-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
overflow: auto;
}

.vjs-tracksettings legend {
color: $primary-foreground-color;
}

.vjs-caption-settings .vjs-tracksettings-colors,
.vjs-caption-settings .vjs-tracksettings-font {
float: left;
Expand Down
5 changes: 4 additions & 1 deletion src/js/control-bar/progress-control/play-progress-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ class PlayProgressBar extends Component {
this.player_.currentTime();

const content = formatTime(time, this.player_.duration());
const timeTooltip = this.getChild('timeTooltip');

this.getChild('timeTooltip').update(seekBarRect, seekBarPoint, content);
if (timeTooltip) {
timeTooltip.update(seekBarRect, seekBarPoint, content);
}
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class CaptionSettingsMenuItem extends TextTrackMenuItem {
// CaptionSettingsMenuItem has no concept of 'selected'
options.selectable = false;

options.name = 'CaptionSettingsMenuItem';

super(player, options);
this.addClass('vjs-texttrack-settings');
this.controlText(', opens ' + options.kind + ' settings dialog');
Expand All @@ -52,7 +54,6 @@ class CaptionSettingsMenuItem extends TextTrackMenuItem {
handleClick(event) {
this.player().getChild('textTrackSettings').open();
}

}

Component.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);
Expand Down
7 changes: 6 additions & 1 deletion src/js/menu/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ class Menu extends Component {
// Unpress the associated MenuButton, and move focus back to it
if (this.menuButton_) {
this.menuButton_.unpressButton();
this.menuButton_.focus();

// don't focus menu button if item is a caption settings item
// because focus will move elsewhere and it logs an error on IE8
if (component.name() !== 'CaptionSettingsMenuItem') {
this.menuButton_.focus();
}
}
}));
}
Expand Down

0 comments on commit cb890a9

Please sign in to comment.