Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
eb4c09fc
Commit
eb4c09fc
authored
Dec 05, 2011
by
Dries Buytaert
Browse files
- Patch
#1342760
by Everett Zufelt: add aria-sort to table sort.
parent
dd1cc680
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/includes/tablesort.inc
View file @
eb4c09fc
...
...
@@ -134,6 +134,10 @@ function tablesort_header($cell, $header, $ts) {
if
(
is_array
(
$cell
)
&&
isset
(
$cell
[
'field'
]))
{
$title
=
t
(
'sort by @s'
,
array
(
'@s'
=>
$cell
[
'data'
]));
if
(
$cell
[
'data'
]
==
$ts
[
'name'
])
{
// aria-sort is a WAI-ARIA property that indicates if items in a table
// or grid are sorted in ascending or descending order. See
// http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort
$cell
[
'aria-sort'
]
=
(
$ts
[
'sort'
]
==
'asc'
)
?
'ascending'
:
'descending'
;
$ts
[
'sort'
]
=
((
$ts
[
'sort'
]
==
'asc'
)
?
'desc'
:
'asc'
);
$cell
[
'class'
][]
=
'active'
;
$image
=
theme
(
'tablesort_indicator'
,
array
(
'style'
=>
$ts
[
'sort'
]));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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