Commit 8e2c5bca by jmclaus

Added focus tracking to play/pause button. This fixes a bug where the tabbing,…

Added focus tracking to play/pause button. This fixes a bug where the tabbing, in certain condition, would get stuck on speed button.
parent 578e02b5
......@@ -77,6 +77,11 @@ function () {
state.el.on('mousemove', state.videoControl.showControls);
state.el.on('keydown', state.videoControl.showControls);
}
// The state.previousFocus is used in video_speed_control to track
// the element that had the focus before it.
state.videoControl.playPauseEl.on('blur', function () {
state.previousFocus = 'playPause';
});
}
// ***************************************************************
......
......@@ -126,7 +126,7 @@ function () {
// the volume clontrol.
state.volumeBlur = true;
// The following field is used in video_speed_control to track
// the element that had the focus.
// the element that had the focus before it.
state.previousFocus = 'volume';
});
}
......
......@@ -188,7 +188,7 @@ function () {
// If we are tabbing forward (previous focus is empty ie
// play button), we open the dialog and set focus on the
// first speed entry.
if (state.previousFocus === '') {
if (state.previousFocus === 'playPause') {
state.videoSpeedControl.el.addClass('open');
state.videoSpeedControl.videoSpeedsEl
.find('a.speed_link:first')
......@@ -205,7 +205,6 @@ function () {
.focus();
}
state.previousFocus = '';
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment