Skip to content

Commit

Permalink
fix: Disable all time tooltips in IE8, as they are broken (#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
misteroneill authored and brandonocasey committed Feb 3, 2017
1 parent da2a1e0 commit 60bcc99
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/js/control-bar/progress-control/mouse-time-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
* @file mouse-time-display.js
*/
import Component from '../../component.js';
// import * as Dom from '../../utils/dom.js';
import * as Fn from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
// import computedStyle from '../../utils/computed-style.js';

import './time-tooltip';

Expand Down Expand Up @@ -34,7 +32,7 @@ class MouseTimeDisplay extends Component {
}

/**
* Create the the DOM element for this class.
* Create the DOM element for this class.
*
* @return {Element}
* The element that was created.
Expand Down
9 changes: 6 additions & 3 deletions src/js/control-bar/progress-control/play-progress-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* @file play-progress-bar.js
*/
import Component from '../../component.js';
import {IE_VERSION} from '../../utils/browser.js';
import formatTime from '../../utils/format-time.js';

import './time-tooltip';
Expand Down Expand Up @@ -77,10 +78,12 @@ class PlayProgressBar extends Component {
* @private
*/
PlayProgressBar.prototype.options_ = {
children: [
'timeTooltip'
]
children: []
};

if (!IE_VERSION || IE_VERSION > 8) {
PlayProgressBar.prototype.options_.children.push('timeTooltip');
}

Component.registerComponent('PlayProgressBar', PlayProgressBar);
export default PlayProgressBar;
10 changes: 6 additions & 4 deletions src/js/control-bar/progress-control/progress-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* @file progress-control.js
*/
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import * as Dom from '../../utils/dom.js';
import { throttle, bind } from '../../utils/fn.js';
import {throttle, bind} from '../../utils/fn.js';

import './seek-bar.js';

Expand All @@ -27,7 +26,7 @@ class ProgressControl extends Component {
*/
constructor(player, options) {
super(player, options);
this.handleMouseMove = Fn.throttle(Fn.bind(this, this.handleMouseMove), 25);
this.handleMouseMove = throttle(bind(this, this.handleMouseMove), 25);
this.on(this.el_, 'mousemove', this.handleMouseMove);

this.throttledHandleMouseSeek = throttle(bind(this, this.handleMouseSeek), 25);
Expand Down Expand Up @@ -57,6 +56,7 @@ class ProgressControl extends Component {
*/
handleMouseMove(event) {
const seekBar = this.getChild('seekBar');
const mouseTimeDisplay = seekBar.getChild('mouseTimeDisplay');
const seekBarEl = seekBar.el();
const seekBarRect = Dom.getBoundingClientRect(seekBarEl);
let seekBarPoint = Dom.getPointerPosition(seekBarEl, event).x;
Expand All @@ -70,7 +70,9 @@ class ProgressControl extends Component {
seekBarPoint = 0;
}

seekBar.getChild('mouseTimeDisplay').update(seekBarRect, seekBarPoint);
if (mouseTimeDisplay) {
mouseTimeDisplay.update(seekBarRect, seekBarPoint);
}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/js/control-bar/progress-control/seek-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import Slider from '../../slider/slider.js';
import Component from '../../component.js';
import {IE_VERSION} from '../../utils/browser.js';
import * as Dom from '../../utils/dom.js';
import * as Fn from '../../utils/fn.js';
import formatTime from '../../utils/format-time.js';
Expand Down Expand Up @@ -177,12 +178,15 @@ class SeekBar extends Slider {
SeekBar.prototype.options_ = {
children: [
'loadProgressBar',
'mouseTimeDisplay',
'playProgressBar'
],
barName: 'playProgressBar'
};

if (!IE_VERSION || IE_VERSION > 8) {
SeekBar.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay');
}

/**
* Call the update event for this Slider when this event happens on the player.
*
Expand Down

0 comments on commit 60bcc99

Please sign in to comment.