Skip to content

Commit c3e7feb

Browse files
author
Felix Milea-Ciobanu
committed
make appointment group calendar sections KO + VO friendly
fixes CNVS-33159 test plan: - as a teacher, navigate to the calendar - create a new event with the + button in the top right - select the appointment group tab - tab down to the "Select Calendars" button - press enter to expand a list of courses - tab through and note that the icons to expand/collapse the courses are highlighted and display an appropriate label - note that course sections are tab-able as expected Change-Id: Ia1611a56e0cdb16f793ec2a469968b019b227b61 Reviewed-on: https://gerrit.instructure.com/94865 Tested-by: Jenkins Reviewed-by: Steven Burnett <sburnett@instructure.com> QA-Review: Nathan Rogowski <nathan@instructure.com> Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
1 parent 35a6eda commit c3e7feb

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

app/coffeescripts/calendar/ContextSelector.coffee

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
define [
22
'jquery'
33
'underscore'
4+
'i18n!context_sector'
45
'jst/calendar/contextSelector'
56
'jst/calendar/contextSelectorItem'
67
'compiled/fn/preventDefault'
7-
], ($, _, contextSelectorTemplate, contextSelectorItemTemplate, preventDefault) ->
8+
], ($, _, I18n, contextSelectorTemplate, contextSelectorItemTemplate, preventDefault) ->
89

910
class ContextSelectorItem
1011
constructor: (@context) ->
@@ -23,8 +24,14 @@ define [
2324
@$sectionCheckboxes.change @sectionChange
2425

2526
toggleSections: (e) =>
26-
@$listItem.find('.ag_sections_toggle').toggleClass('ag-sections-expanded')
2727
@$sectionsList.toggleClass('hidden')
28+
$toggle = @$listItem.find('.ag_sections_toggle')
29+
$toggle.toggleClass('ag-sections-expanded')
30+
31+
if $toggle.hasClass('ag-sections-expanded')
32+
$toggle.find('.screenreader-only').text(I18n.t('Hide course sections for course %{name}', { name: @context.name }))
33+
else
34+
$toggle.find('.screenreader-only').text(I18n.t('Show course sections for course %{name}', { name: @context.name }))
2835

2936
change: =>
3037
newState = switch @state

app/stylesheets/pages/calendar/_scheduler.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@
217217
float: left;
218218
background-image: url(/images/jqueryui/icon_sprite.png);
219219
background-position: (-16px) -80px;
220+
border: none;
221+
background-color: transparent;
220222
}
221223

222224
.ag-sections-expanded {

app/views/jst/calendar/contextSelectorItem.handlebars

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<li>
2-
<a class="ag_sections_toggle"></a>
32
<input type="checkbox" name="context_codes[]" value="{{asset_string}}" id="option_{{asset_string}}">
43
<label for="option_{{asset_string}}">{{name}}</label>
4+
<button class="ag_sections_toggle">
5+
<span class="screenreader-only">{{#t}}Show course sections for course {{name}}{{/t}}</span>
6+
</button>
57
<ul class="ag_sections hidden">
68
{{#each course_sections}}
79
{{#if can_create_ag}}
810
<li>
911
<input type="checkbox" name="sections[]" value="{{asset_string}}" id="option_{{asset_string}}">
10-
<label for="option_{{asset_string}}">{{name}}</label>
12+
<label for="option_{{asset_string}}" aria-label="{{#t}}Course Section {{name}}{{/t}}">{{name}}</label>
1113
</li>
1214
{{/if}}
1315
{{/each}}

0 commit comments

Comments
 (0)