From 3a5d7d8638f9253500d23df926019c79252263fe Mon Sep 17 00:00:00 2001 From: jmclaus Date: Tue, 24 Sep 2013 12:12:10 +0200 Subject: [PATCH] Addressed PR comments --- .../xmodule/js/spec/video/video_speed_control_spec.js | 10 ++++++---- .../xmodule/js/src/video/08_video_speed_control.js | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js index 13a5705238..2684fb738e 100644 --- a/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js +++ b/common/lib/xmodule/xmodule/js/spec/video/video_speed_control_spec.js @@ -140,20 +140,22 @@ }); describe('make sure the speed control gets the focus afterwards', function() { - beforeEach(function() { + var anchor; + beforeEach(function() { initialize(); + anchor= $('.speeds > a').first(); videoSpeedControl.setSpeed(1.0); - spyOnEvent(state.videoSpeedControl.mainAnchor, 'focus'); + spyOnEvent(anchor, 'focus'); }); it('when the speed is the same', function() { $('li[data-speed="1.0"] a').click(); - expect('focus').toHaveBeenTriggeredOn(state.videoSpeedControl.mainAnchor); + expect('focus').toHaveBeenTriggeredOn(anchor); }); it('when the speed is not the same', function() { $('li[data-speed="0.75"] a').click(); - expect('focus').toHaveBeenTriggeredOn(state.videoSpeedControl.mainAnchor); + expect('focus').toHaveBeenTriggeredOn(anchor); }); }); }); diff --git a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js index 2ba8a30144..67f62edf95 100644 --- a/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js +++ b/common/lib/xmodule/xmodule/js/src/video/08_video_speed_control.js @@ -62,8 +62,6 @@ function () { state.videoSpeedControl.el = state.el.find('div.speeds'); - state.videoSpeedControl.mainAnchor = state.videoSpeedControl.el.children('a'); - state.videoSpeedControl.videoSpeedsEl = state.videoSpeedControl.el .find('.video_speeds');