From ba954ff1647b8f3e536ade87d6d9bd0e00a16621 Mon Sep 17 00:00:00 2001 From: Valera Rozuvan Date: Tue, 27 Aug 2013 10:19:55 +0300 Subject: [PATCH] Fixing code as per suggestions on PR 771. --- .../xmodule/xmodule/js/src/video/09_video_caption.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js index 69ec14d4ff..e597f2736c 100644 --- a/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js +++ b/common/lib/xmodule/xmodule/js/src/video/09_video_caption.js @@ -28,11 +28,9 @@ function () { // Depending on whether captions file could be loaded, the following // function invocation can succeed or fail. If it fails, we do not // go on with binding handlers to events. - if (!state.videoCaption.renderElements()) { - return; + if (state.videoCaption.renderElements()) { + state.videoCaption.bindHandlers(); } - - state.videoCaption.bindHandlers(); }; // *************************************************************** @@ -102,9 +100,6 @@ function () { this.videoCaption.subtitlesEl = this.el.find('ol.subtitles'); this.videoCaption.hideSubtitlesEl = this.el.find('a.hide-subtitles'); - this.el.find('.video-wrapper').after(this.videoCaption.subtitlesEl); - this.el.find('.video-controls .secondary-controls').append(this.videoCaption.hideSubtitlesEl); - // Fetch the captions file. If no file was specified, then we hide // the "CC" button, and return. if (!this.videoCaption.fetchCaption()) { @@ -113,6 +108,9 @@ function () { return false; } + this.el.find('.video-wrapper').after(this.videoCaption.subtitlesEl); + this.el.find('.video-controls .secondary-controls').append(this.videoCaption.hideSubtitlesEl); + this.videoCaption.setSubtitlesHeight(); if (this.videoType === 'html5') {