Added focus tracking to play/pause button. This fixes a bug where the tabbing, in certain condition, would get stuck on speed button.

This commit is contained in:
jmclaus
2013-09-04 12:11:23 +02:00
parent 578e02b589
commit 8e2c5bca7b
3 changed files with 7 additions and 3 deletions

View File

@@ -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';
});
}
// ***************************************************************

View File

@@ -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';
});
}

View File

@@ -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 = '';
});