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:
@@ -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 = '';
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user