Commit 7659c5b1 by jmclaus

Removed unfocused class and set the captions default values of outline-width and…

Removed unfocused class and set the captions default values of outline-width and outline-style to it.
parent 752e1d8b
...@@ -525,17 +525,14 @@ div.video { ...@@ -525,17 +525,14 @@ div.video {
margin-bottom: 8px; margin-bottom: 8px;
padding: 0; padding: 0;
line-height: lh(); line-height: lh();
outline-width: 0px;
outline-style: none;
&.current { &.current {
color: #333; color: #333;
font-weight: 700; font-weight: 700;
} }
&.unfocused {
outline-width: 0px;
outline-style: none;
}
&.focused { &.focused {
outline-width: 1px; outline-width: 1px;
outline-style: dotted; outline-style: dotted;
......
...@@ -319,8 +319,6 @@ function () { ...@@ -319,8 +319,6 @@ function () {
'tabindex': 0 'tabindex': 0
}); });
liEl.addClass('unfocused');
container.append(liEl); container.append(liEl);
}); });
...@@ -367,10 +365,10 @@ function () { ...@@ -367,10 +365,10 @@ function () {
captionIndex = parseInt(caption.attr('data-index'), 10); captionIndex = parseInt(caption.attr('data-index'), 10);
if (captionIndex === this.videoCaption.currentCaptionIndex) { if (captionIndex === this.videoCaption.currentCaptionIndex) {
if (event.type === 'mouseover') { if (event.type === 'mouseover') {
caption.removeClass('focused').addClass('unfocused'); caption.removeClass('focused');
} }
else { // mouseout else { // mouseout
caption.removeClass('unfocused').addClass('focused'); caption.addClass('focused');
} }
} }
} }
...@@ -379,7 +377,7 @@ function () { ...@@ -379,7 +377,7 @@ function () {
var caption = $(event.target); var caption = $(event.target);
this.videoCaption.isMouseFocus = true; this.videoCaption.isMouseFocus = true;
this.videoCaption.autoScrolling = true; this.videoCaption.autoScrolling = true;
caption.removeClass('focused').addClass('unfocused'); caption.removeClass('focused');
this.videoCaption.currentCaptionIndex = -1; this.videoCaption.currentCaptionIndex = -1;
} }
...@@ -395,14 +393,14 @@ function () { ...@@ -395,14 +393,14 @@ function () {
// caption list (ie -1) to disable mouseenter, mouseleave behavior. // caption list (ie -1) to disable mouseenter, mouseleave behavior.
if (this.videoCaption.isMouseFocus) { if (this.videoCaption.isMouseFocus) {
this.videoCaption.autoScrolling = true; this.videoCaption.autoScrolling = true;
caption.removeClass('focused').addClass('unfocused'); caption.removeClass('focused');
this.videoCaption.currentCaptionIndex = -1; this.videoCaption.currentCaptionIndex = -1;
} }
// If the focus comes from tabbing, show the outline and turn off // If the focus comes from tabbing, show the outline and turn off
// automatic scrolling. // automatic scrolling.
else { else {
this.videoCaption.currentCaptionIndex = captionIndex; this.videoCaption.currentCaptionIndex = captionIndex;
caption.removeClass('unfocused').addClass('focused'); caption.addClass('focused');
// The second and second to last elements turn automatic scrolling // The second and second to last elements turn automatic scrolling
// off again as it may have been enabled in captionBlur. // off again as it may have been enabled in captionBlur.
if (captionIndex <= 1 || captionIndex >= this.videoCaption.captions.length-2) { if (captionIndex <= 1 || captionIndex >= this.videoCaption.captions.length-2) {
...@@ -414,7 +412,7 @@ function () { ...@@ -414,7 +412,7 @@ function () {
function captionBlur(event) { function captionBlur(event) {
var caption = $(event.target), var caption = $(event.target),
captionIndex = parseInt(caption.attr('data-index'), 10); 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 // 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 // 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 // are tabbing. So we could be on the first element and tabbing back out
......
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