Commit 74abec3f by clrux

Merge pull request #12430 from edx/clrux/ac-408

AC-408 converting video slider controls from a to div
parents d95a4c85 e0da408f
...@@ -417,6 +417,7 @@ ...@@ -417,6 +417,7 @@
margin-left: -($baseline / 8); // center-center causes the control to be beyond the end of the sider margin-left: -($baseline / 8); // center-center causes the control to be beyond the end of the sider
border: 0; border: 0;
border-radius: ($baseline / 5); border-radius: ($baseline / 5);
padding: 0;
background: rgb(203, 89, 141); // UXPL secondary base background: rgb(203, 89, 141); // UXPL secondary base
box-shadow: none; box-shadow: none;
...@@ -680,9 +681,11 @@ ...@@ -680,9 +681,11 @@
@include left(-5px); @include left(-5px);
height: 15px; height: 15px;
width: 15px; width: 15px;
background: rgb(203, 89, 141); // UXPL secondary base
border: 0; border: 0;
border-radius: ($baseline / 5); border-radius: ($baseline / 5);
padding: 0;
background: rgb(203, 89, 141); // UXPL secondary base
box-shadow: none;
&:hover, &:hover,
&:focus { &:focus {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
}); });
it('add ARIA attributes to time control', function () { it('add ARIA attributes to time control', function () {
var timeControl = $('div.slider > a'); var timeControl = $('div.slider > .progress-handle');
expect(timeControl).toHaveAttrs({ expect(timeControl).toHaveAttrs({
'role': 'slider', 'role': 'slider',
......
...@@ -79,7 +79,7 @@ function () { ...@@ -79,7 +79,7 @@ function () {
// ARIA // ARIA
// We just want the knob to be selectable with keyboard // We just want the knob to be selectable with keyboard
state.videoProgressSlider.el.attr('tabindex', -1); state.videoProgressSlider.el.attr('tabindex', -1);
// Let screen readers know that this anchor, representing the slider // Let screen readers know that this div, representing the slider
// handle, behaves as a slider named 'video position'. // handle, behaves as a slider named 'video position'.
state.videoProgressSlider.handle.attr({ state.videoProgressSlider.handle.attr({
'role': 'slider', 'role': 'slider',
...@@ -89,7 +89,8 @@ function () { ...@@ -89,7 +89,8 @@ function () {
.slider.slider('option', 'value')), .slider.slider('option', 'value')),
'aria-valuemax': state.videoPlayer.duration(), 'aria-valuemax': state.videoPlayer.duration(),
'aria-valuemin': '0', 'aria-valuemin': '0',
'aria-valuenow': state.videoPlayer.currentTime 'aria-valuenow': state.videoPlayer.currentTime,
'tabindex': '0'
}); });
state.el.on('destroy', state.videoProgressSlider.destroy); state.el.on('destroy', state.videoProgressSlider.destroy);
...@@ -103,6 +104,9 @@ function () { ...@@ -103,6 +104,9 @@ function () {
// *************************************************************** // ***************************************************************
function buildSlider() { function buildSlider() {
this.videoProgressSlider.el
.append('<div class="ui-slider-handle progress-handle"></div>');
this.videoProgressSlider.slider = this.videoProgressSlider.el this.videoProgressSlider.slider = this.videoProgressSlider.el
.slider({ .slider({
range: 'min', range: 'min',
......
...@@ -121,6 +121,9 @@ function() { ...@@ -121,6 +121,9 @@ function() {
*/ */
render: function() { render: function() {
var container = this.el.find('.volume-slider'); var container = this.el.find('.volume-slider');
container
.append('<div class="ui-slider-handle volume-handle"></div>');
this.volumeSlider = container.slider({ this.volumeSlider = container.slider({
orientation: 'vertical', orientation: 'vertical',
...@@ -133,7 +136,7 @@ function() { ...@@ -133,7 +136,7 @@ function() {
// We provide an independent behavior to adjust volume level. // We provide an independent behavior to adjust volume level.
// Therefore, we do not need redundant focusing on slider in TAB // Therefore, we do not need redundant focusing on slider in TAB
// order. // order.
container.find('a').attr('tabindex', -1); container.find('.volume-handle').attr('tabindex', -1);
this.state.el.find('.secondary-controls').append(this.el); this.state.el.find('.secondary-controls').append(this.el);
}, },
......
...@@ -356,7 +356,6 @@ class CMSVideoA11yTest(CMSVideoBaseTest): ...@@ -356,7 +356,6 @@ class CMSVideoA11yTest(CMSVideoBaseTest):
# limit the scope of the audit to the video player only. # limit the scope of the audit to the video player only.
self.outline.a11y_audit.config.set_scope( self.outline.a11y_audit.config.set_scope(
include=["div.video"], include=["div.video"]
exclude=["a.ui-slider-handle"]
) )
self.outline.a11y_audit.check_for_accessibility_errors() self.outline.a11y_audit.check_for_accessibility_errors()
...@@ -1270,7 +1270,6 @@ class LMSVideoModuleA11yTest(VideoBaseTest): ...@@ -1270,7 +1270,6 @@ class LMSVideoModuleA11yTest(VideoBaseTest):
# limit the scope of the audit to the video player only. # limit the scope of the audit to the video player only.
self.video.a11y_audit.config.set_scope( self.video.a11y_audit.config.set_scope(
include=["div.video"], include=["div.video"]
exclude=["a.ui-slider-handle"]
) )
self.video.a11y_audit.check_for_accessibility_errors() self.video.a11y_audit.check_for_accessibility_errors()
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