From 9188f9682cf98a0e6c36f4b2ef70654783ba2625 Mon Sep 17 00:00:00 2001 From: Peter Fogg Date: Thu, 10 Mar 2016 16:43:12 -0500 Subject: [PATCH] Accessibility fixes for the course home page. ECOM-3799 --- .../courseware/toggle_element_visibility.js | 8 +++- lms/static/sass/course/_info.scss | 14 +++++- lms/static/sass/course/base/_extends.scss | 47 ++++++------------- lms/templates/courseware/course_updates.html | 45 +++++++++++++----- lms/templates/courseware/info.html | 14 ++---- 5 files changed, 71 insertions(+), 57 deletions(-) diff --git a/lms/static/js/courseware/toggle_element_visibility.js b/lms/static/js/courseware/toggle_element_visibility.js index 353c6a8078..4b204679ad 100644 --- a/lms/static/js/courseware/toggle_element_visibility.js +++ b/lms/static/js/courseware/toggle_element_visibility.js @@ -9,14 +9,18 @@ var toggleActionElements = $('.toggle-visibility-button'); var updateToggleActionText = function (elementIsHidden, actionElement) { - var show_text = actionElement.data('show'); - var hide_text = actionElement.data('hide'); + var show_text = actionElement.data('show'), + hide_text = actionElement.data('hide'), + first_hidden_update = $('.old-updates .toggle-visibility-button').first(); + + actionElement.attr('aria-expanded', elementIsHidden); if (elementIsHidden) { if (hide_text) { actionElement.html(actionElement.data('hide')); } else { actionElement.hide(); + first_hidden_update.focus(); } } else { if (show_text) { diff --git a/lms/static/sass/course/_info.scss b/lms/static/sass/course/_info.scss index f20bfe4baa..4276015d22 100644 --- a/lms/static/sass/course/_info.scss +++ b/lms/static/sass/course/_info.scss @@ -82,6 +82,13 @@ div.info-wrapper { display: block; text-align: center; cursor: pointer; + background: none; + + &:hover, &:focus { + background-color: unset; + color: $m-blue-d3; + border: 1px solid black; + } } > li,article { @@ -109,7 +116,12 @@ div.info-wrapper { .toggle-visibility-button { @extend %t-title9; @include float(right); + padding: 0; cursor: pointer; + background: none; + border: none; + color: $blue; + font-weight: normal; } .toggle-visibility-element { @@ -175,7 +187,7 @@ div.info-wrapper { right: auto; } - h1 { + .handouts-header { @include text-align(left); @extend %t-strong; @extend %t-title6; diff --git a/lms/static/sass/course/base/_extends.scss b/lms/static/sass/course/base/_extends.scss index b309e677da..305a8ed9b4 100644 --- a/lms/static/sass/course/base/_extends.scss +++ b/lms/static/sass/course/base/_extends.scss @@ -67,8 +67,7 @@ h1.top-header { width: flex-grid(3); background: $sidebar-color; - h1, h2 { - font-size: em(20); + h1, h2, h3, h4 { font-weight: bold; letter-spacing: 0; text-transform: none; @@ -79,7 +78,19 @@ h1.top-header { h1 { font-size: 18px; - padding: 32px 26px 20px 26px; + margin-bottom: 15px; + } + + h2 { + font-size: 16px; + } + + h3 { + font-size: 14px; + } + + h4 { + font-size: 12px; } a { @@ -95,40 +106,12 @@ h1.top-header { display: none; } - h3 { - background: none; - border: none; - color: $black; - font-weight: normal; - margin: 0; - overflow: hidden; - font-size: 1em; - - a { - display: block; - text-decoration: none; - @include transition(none); - } - - &.active { - // @extend .bottom-border; - color: $black; - font-weight: bold; - - a { - color: $black; - } - } - } - ul, ol { - list-style: none; margin: 0; padding-left: 0; li { - // @extend .bottom-border; - @extend .clearfix; + @include margin-left(20px); background: none; position: relative; padding: 0; diff --git a/lms/templates/courseware/course_updates.html b/lms/templates/courseware/course_updates.html index 6fc936b753..e0ce14746c 100644 --- a/lms/templates/courseware/course_updates.html +++ b/lms/templates/courseware/course_updates.html @@ -4,26 +4,47 @@ % for index, update in enumerate(visible_updates):
% if not update.get("is_error"): -

${update.get("date")}

- +

${update.get("date")}

+ % endif -
+
${update.get("content")}
% endfor -