Commit a7f3bb2b by Valera Rozuvan

Added back on hover CC button functionality.

Fixing falling test. Added fix for RequireJS & XModule loader video race condition.
Removed unnecessary comments from SCSS and JS files.
Added entry to Change Log.
parent 14c63f0d
...@@ -5,6 +5,11 @@ These are notable changes in edx-platform. This is a rolling list of changes, ...@@ -5,6 +5,11 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected. the top. Include a label indicating the component affected.
Blades: Hovering over CC button in video player, when transcripts are hidden,
will cause them to show up. Moving the mouse from the CC button will auto hide
them. You can hover over the CC button and then move the mouse to the
transcripts which will allow you to select some video position in 1 click.
Blades: Add possibility to use multiple LTI tools per page. Blades: Add possibility to use multiple LTI tools per page.
Blades: LTI module can now load external content in a new window. Blades: LTI module can now load external content in a new window.
......
...@@ -35,7 +35,7 @@ def click_new_component_button(step, component_button_css): ...@@ -35,7 +35,7 @@ def click_new_component_button(step, component_button_css):
step.given('I have clicked the new unit button') step.given('I have clicked the new unit button')
world.wait_for_requirejs( world.wait_for_requirejs(
["jquery", "js/models/course", "coffee/src/models/module", ["jquery", "js/models/course", "coffee/src/models/module",
"coffee/src/views/unit", "jquery.ui"] "coffee/src/views/unit", "jquery.ui", "domReady!"]
) )
world.css_click(component_button_css) world.css_click(component_button_css)
......
...@@ -638,8 +638,6 @@ div.video { ...@@ -638,8 +638,6 @@ div.video {
ol.subtitles { ol.subtitles {
width: 0; width: 0;
height: 0; height: 0;
visibility: hidden;
} }
ol.subtitles.html5 { ol.subtitles.html5 {
...@@ -673,8 +671,6 @@ div.video { ...@@ -673,8 +671,6 @@ div.video {
ol.subtitles { ol.subtitles {
right: -(flex-grid(4)); right: -(flex-grid(4));
width: auto; width: auto;
visibility: hidden;
} }
} }
......
...@@ -182,7 +182,6 @@ function () { ...@@ -182,7 +182,6 @@ function () {
this.videoCaption.hideSubtitlesEl.on({ this.videoCaption.hideSubtitlesEl.on({
mousemove: this.videoCaption.autoShowCaptions, mousemove: this.videoCaption.autoShowCaptions,
focus: this.videoCaption.autoShowCaptions,
mouseout: this.videoCaption.autoHideCaptions, mouseout: this.videoCaption.autoHideCaptions,
blur: this.videoCaption.autoHideCaptions blur: this.videoCaption.autoHideCaptions
...@@ -677,6 +676,7 @@ function () { ...@@ -677,6 +676,7 @@ function () {
event.preventDefault(); event.preventDefault();
if (this.el.hasClass('closed')) { if (this.el.hasClass('closed')) {
this.videoCaption.autoShowCaptions();
this.videoCaption.hideCaptions(false); this.videoCaption.hideCaptions(false);
} else { } else {
this.videoCaption.hideCaptions(true); this.videoCaption.hideCaptions(true);
......
(function (requirejs, require, define) { (function (requirejs, require, define) {
// In the case when the Video constructor will be called before
// RequireJS finishes loading all of the Video dependencies, we will have
// a mock function that will collect all the elements that must be
// initialized as Video elements.
//
// Once RequireJS will load all of the necessary dependencies, main code
// will invoke the mock function with the second parameter set to truthy value.
// This will trigger the actual Video constructor on all elements that
// are stored in a temporary list.
window.Video = (function () {
// Temporary storage place for elements that must be initialized as Video
// elements.
var tempCallStack = [];
return function (element, processTempCallStack) {
// If mock function was called with second parameter set to truthy
// value, we invoke the real `window.Video` on all the stored elements
// so far.
if (processTempCallStack) {
$.each(tempCallStack, function (index, element) {
// By now, `window.Video` is the real constructor.
window.Video(element);
});
return;
}
// If normal call to `window.Video` constructor, store the element
// for later initializing.
tempCallStack.push(element);
// Real Video constructor returns the `state` object. The mock
// function will return an empty object.
return {};
};
}());
// Main module. // Main module.
require( require(
[ [
...@@ -23,7 +60,8 @@ function ( ...@@ -23,7 +60,8 @@ function (
VideoCaption VideoCaption
) { ) {
var previousState, var previousState,
youtubeXhr = null; youtubeXhr = null,
oldVideo = window.Video;
// Because this constructor can be called multiple times on a single page (when // Because this constructor can be called multiple times on a single page (when
// the user switches verticals, the page doesn't reload, but the content changes), we must // the user switches verticals, the page doesn't reload, but the content changes), we must
...@@ -79,6 +117,10 @@ function ( ...@@ -79,6 +117,10 @@ function (
window.Video.clearYoutubeXhr = function () { window.Video.clearYoutubeXhr = function () {
youtubeXhr = null; youtubeXhr = null;
}; };
// Invoke the mock Video constructor so that the elements stored within
// it can be processed by the real `window.Video` constructor.
oldVideo(null, true);
}); });
}(RequireJS.requirejs, RequireJS.require, RequireJS.define)); }(RequireJS.requirejs, RequireJS.require, RequireJS.define));
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