Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
29b719f3
Commit
29b719f3
authored
Nov 23, 2015
by
Christine Lytwynec
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10527 from edx/clytwynec/ac-230
Navigation dropdown link should be button
parents
6a92d4cb
c6f4afc9
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
18 deletions
+39
-18
common/test/acceptance/tests/lms/test_account_settings.py
+1
-1
common/test/acceptance/tests/lms/test_lms_dashboard.py
+1
-1
lms/static/js/my_courses_dropdown.js
+14
-13
lms/static/sass/shared/_header.scss
+21
-1
lms/templates/navigation-edx.html
+1
-1
lms/templates/navigation.html
+1
-1
No files found.
common/test/acceptance/tests/lms/test_account_settings.py
View file @
29b719f3
...
...
@@ -461,7 +461,7 @@ class AccountSettingsA11yTest(AccountSettingsTestMixin, WebAppTest):
self
.
visit_account_settings_page
()
self
.
account_settings_page
.
a11y_audit
.
config
.
set_rules
({
'ignore'
:
[
'link-href'
,
# TODO: AC-233, AC-23
0
'link-href'
,
# TODO: AC-233, AC-23
8
'skip-link'
,
# TODO: AC-179
],
})
...
...
common/test/acceptance/tests/lms/test_lms_dashboard.py
View file @
29b719f3
...
...
@@ -236,7 +236,7 @@ class LmsDashboardA11yTest(BaseLmsDashboardTest):
self
.
dashboard_page
.
a11y_audit
.
config
.
set_rules
({
"ignore"
:
[
'skip-link'
,
# TODO: AC-179
'link-href'
,
# TODO: AC-23
0
'link-href'
,
# TODO: AC-23
8, AC-179
],
})
...
...
lms/static/js/my_courses_dropdown.js
View file @
29b719f3
$
(
document
).
ready
(
function
()
{
'use strict'
;
// define variables for code legibility
var
dropdownMenuToggle
=
$
(
'
a
.dropdown'
);
var
dropdownMenu
=
$
(
'
ul
.dropdown-menu'
);
var
dropdownMenuToggle
=
$
(
'.dropdown'
);
var
dropdownMenu
=
$
(
'.dropdown-menu'
);
var
menuItems
=
dropdownMenu
.
find
(
'a'
);
// bind menu toggle click for later use
dropdownMenuToggle
.
toggle
(
function
()
{
dropdownMenu
.
addClass
(
"expanded"
).
find
(
'a'
).
first
().
focus
();
...
...
@@ -12,7 +14,7 @@ $(document).ready(function () {
dropdownMenu
.
removeClass
(
"expanded"
);
dropdownMenuToggle
.
removeClass
(
"active"
).
attr
(
"aria-expanded"
,
"false"
).
focus
();
});
//catch keypresses when focused on dropdownMenuToggle (we only care about spacebar keypresses here)
dropdownMenuToggle
.
on
(
'keydown'
,
function
(
event
){
// if space key pressed
...
...
@@ -21,12 +23,12 @@ $(document).ready(function () {
event
.
preventDefault
();
}
});
//catch keypresses when inside dropdownMenu (we want to catch spacebar; escape; up arrow or shift+tab; and down arrow or tab)
dropdownMenu
.
on
(
'keydown'
,
function
(
event
){
catchKeyPress
(
$
(
this
),
event
);
});
function
catchKeyPress
(
object
,
event
)
{
// get currently focused item
var
focusedItem
=
jQuery
(
':focus'
);
...
...
@@ -36,22 +38,22 @@ $(document).ready(function () {
// get the index of the currently focused item
var
focusedItemIndex
=
menuItems
.
index
(
focusedItem
);
// var to store next focused item index
var
itemToFocusIndex
;
// if space key pressed
if
(
event
.
which
==
32
)
{
dropdownMenuToggle
.
click
();
event
.
preventDefault
();
}
// if escape key pressed
if
(
event
.
which
==
27
)
{
dropdownMenuToggle
.
click
();
event
.
preventDefault
();
}
// if up arrow key pressed or shift+tab
if
(
event
.
which
==
38
||
(
event
.
which
==
9
&&
event
.
shiftKey
))
{
// if first item go to last
...
...
@@ -63,7 +65,7 @@ $(document).ready(function () {
}
event
.
preventDefault
();
}
// if down arrow key pressed or tab key
if
(
event
.
which
==
40
||
event
.
which
==
9
)
{
// if last item go to first
...
...
@@ -76,4 +78,4 @@ $(document).ready(function () {
event
.
preventDefault
();
}
}
});
\ No newline at end of file
});
lms/static/sass/shared/_header.scss
View file @
29b719f3
...
...
@@ -191,6 +191,16 @@ header.global {
}
}
.dropdown
{
font-size
:
$body-font-size
;
padding
:
0
(
$baseline
/
2
);
color
:
$base-font-color
;
border
:
none
;
background
:
$white
;
box-shadow
:
none
;
text-shadow
:
none
;
}
.dropdown-menu
{
background
:
$white
;
border-radius
:
4px
;
...
...
@@ -486,7 +496,7 @@ header.global-new {
}
}
}
a
.user-link
{
a
.user-link
{
@include
padding
(
5px
,
2px
,
10px
,
10px
);
position
:
relative
;
text-transform
:
none
;
...
...
@@ -534,6 +544,16 @@ header.global-new {
}
}
.dropdown
{
font-size
:
$body-font-size
;
padding
:
0
(
$baseline
/
2
);
color
:
$base-font-color
;
border
:
none
;
background
:
$white
;
box-shadow
:
none
;
text-shadow
:
none
;
}
.dropdown-menu
{
background
:
$border-color-4
;
border-radius
:
4px
;
...
...
lms/templates/navigation-edx.html
View file @
29b719f3
...
...
@@ -83,7 +83,7 @@ site_status_msg = get_site_status_msg(course_id)
</a>
</li>
<li
class=
"primary"
>
<
a
href=
"#"
class=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
><span
class=
"sr"
>
${_("More options dropdown")}
</span>
▾
</a
>
<
button
class=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
><span
class=
"sr"
>
${_("More options dropdown")}
</span>
▾
</button
>
<ul
class=
"dropdown-menu"
aria-label=
"More Options"
role=
"menu"
>
<
%
block
name=
"navigation_dropdown_menu_links"
>
<li><a
href=
"${reverse('dashboard')}"
>
${_("Dashboard")}
</a></li>
...
...
lms/templates/navigation.html
View file @
29b719f3
...
...
@@ -86,7 +86,7 @@ site_status_msg = get_site_status_msg(course_id)
</a>
</li>
<li
class=
"primary"
>
<
a
href=
"#"
class=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
><span
class=
"sr"
>
${_("More options dropdown")}
</span><i
class=
"fa fa-sort-desc"
aria-hidden=
"true"
></i></a
>
<
button
class=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"false"
><span
class=
"sr"
>
${_("More options dropdown")}
</span><span
class=
"fa fa-sort-desc"
aria-hidden=
"true"
></span></button
>
<ul
class=
"dropdown-menu"
aria-label=
"More Options"
role=
"menu"
>
<
%
block
name=
"navigation_dropdown_menu_links"
>
<li><a
href=
"${reverse('dashboard')}"
>
${_("Dashboard")}
</a></li>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment