Commit 3ca74c01 by jmclaus

Merge pull request #1084 from edx/jmclaus/bugfix_focus_speed_control

Focus speed control
parents 427386c9 3a5d7d86
......@@ -138,6 +138,26 @@
expect(videoSpeedControl.currentSpeed).toEqual(0.75);
});
});
describe('make sure the speed control gets the focus afterwards', function() {
var anchor;
beforeEach(function() {
initialize();
anchor= $('.speeds > a').first();
videoSpeedControl.setSpeed(1.0);
spyOnEvent(anchor, 'focus');
});
it('when the speed is the same', function() {
$('li[data-speed="1.0"] a').click();
expect('focus').toHaveBeenTriggeredOn(anchor);
});
it('when the speed is not the same', function() {
$('li[data-speed="0.75"] a').click();
expect('focus').toHaveBeenTriggeredOn(anchor);
});
});
});
describe('onSpeedChange', function() {
......
......@@ -283,6 +283,9 @@ function () {
this.videoSpeedControl.currentSpeed
);
}
// When a speed entry has been selected, we want the speed control to
// regain focus.
parentEl.parent().siblings('a').focus();
}
function reRender(params) {
......
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