From 7659c5b13030f5433bfdb4c0a5d7b6dd207b4d09 Mon Sep 17 00:00:00 2001 From: jmclaus Date: Wed, 18 Sep 2013 17:33:56 +0200 Subject: [PATCH] Removed unfocused class and set the captions default values of outline-width and outline-style to it. --- common/lib/xmodule/xmodule/css/video/display.scss | 7 ++----- .../xmodule/js/src/video/09_video_caption.js | 14 ++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/common/lib/xmodule/xmodule/css/video/display.scss b/common/lib/xmodule/xmodule/css/video/display.scss index 7e67207fb0..2dce290a96 100644 --- a/common/lib/xmodule/xmodule/css/video/display.scss +++ b/common/lib/xmodule/xmodule/css/video/display.scss @@ -525,17 +525,14 @@ div.video { margin-bottom: 8px; padding: 0; line-height: lh(); + outline-width: 0px; + outline-style: none; &.current { color: #333; font-weight: 700; } - &.unfocused { - outline-width: 0px; - outline-style: none; - } - &.focused { outline-width: 1px; outline-style: dotted; 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 1855b990af..3dc675b4c2 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 @@ -319,8 +319,6 @@ function () { 'tabindex': 0 }); - liEl.addClass('unfocused'); - container.append(liEl); }); @@ -367,10 +365,10 @@ function () { captionIndex = parseInt(caption.attr('data-index'), 10); if (captionIndex === this.videoCaption.currentCaptionIndex) { if (event.type === 'mouseover') { - caption.removeClass('focused').addClass('unfocused'); + caption.removeClass('focused'); } else { // mouseout - caption.removeClass('unfocused').addClass('focused'); + caption.addClass('focused'); } } } @@ -379,7 +377,7 @@ function () { var caption = $(event.target); this.videoCaption.isMouseFocus = true; this.videoCaption.autoScrolling = true; - caption.removeClass('focused').addClass('unfocused'); + caption.removeClass('focused'); this.videoCaption.currentCaptionIndex = -1; } @@ -395,14 +393,14 @@ function () { // caption list (ie -1) to disable mouseenter, mouseleave behavior. if (this.videoCaption.isMouseFocus) { this.videoCaption.autoScrolling = true; - caption.removeClass('focused').addClass('unfocused'); + caption.removeClass('focused'); this.videoCaption.currentCaptionIndex = -1; } // If the focus comes from tabbing, show the outline and turn off // automatic scrolling. else { this.videoCaption.currentCaptionIndex = captionIndex; - caption.removeClass('unfocused').addClass('focused'); + caption.addClass('focused'); // The second and second to last elements turn automatic scrolling // off again as it may have been enabled in captionBlur. if (captionIndex <= 1 || captionIndex >= this.videoCaption.captions.length-2) { @@ -414,7 +412,7 @@ function () { function captionBlur(event) { var caption = $(event.target), captionIndex = parseInt(caption.attr('data-index'), 10); - caption.removeClass('focused').addClass('unfocused'); + caption.removeClass('focused'); // If we are on first or last index, we have to turn automatic scroll on // again when losing focus. There is no way to know in what direction we // are tabbing. So we could be on the first element and tabbing back out