1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

Fix: grid ARIA role should be on the table, not the container

- Feedback from James Craig - author of WAI-ARIA specification.
This commit is contained in:
Allan Jardine 2014-04-17 09:26:11 +01:00
parent b53ac91310
commit 3fb997f0b8
2 changed files with 7 additions and 3 deletions

View File

@ -1 +1 @@
4d968710b6b942e511f833c96dc45c1533ec1db0
1d7bb5389cc0da4d1176ca115fda46b584d70e50

View File

@ -1994,7 +1994,6 @@
// All DataTables are wrapped in a div
var insert = $('<div/>', {
role: 'grid',
id: oSettings.sTableId+'_wrapper',
'class': classes.sWrapper + (oSettings.nTFoot ? '' : ' '+classes.sNoFooter)
} );
@ -3374,6 +3373,12 @@
*/
function _fnFeatureHtmlTable ( settings )
{
var table = $(settings.nTable);
// Add the ARIA grid role to the table
table.attr( 'role', 'grid' );
// Scrolling from here on in
var scroll = settings.oScroll;
if ( scroll.sX === '' && scroll.sY === '' ) {
@ -3383,7 +3388,6 @@
var scrollX = scroll.sX;
var scrollY = scroll.sY;
var classes = settings.oClasses;
var table = $(settings.nTable);
var caption = table.children('caption');
var captionSide = caption.length ? caption[0]._captionSide : null;
var headerClone = $( table[0].cloneNode(false) );