mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-21 19:54:15 +01:00
Dev fix: IE7 is throwing an error when using $().removeAttr() and
$().attr() for the aria sorting information
This commit is contained in:
parent
63cfae90a2
commit
eda09a9087
@ -1 +1 @@
|
|||||||
39ebe10e08589a9fd762923040294153981ad46b
|
e0c0ec0ea75a30d94f4b0a0949d70368c2aca605
|
||||||
|
10
media/js/jquery.dataTables.js
vendored
10
media/js/jquery.dataTables.js
vendored
@ -4352,12 +4352,16 @@
|
|||||||
var col = columns[i];
|
var col = columns[i];
|
||||||
var asSorting = col.asSorting;
|
var asSorting = col.asSorting;
|
||||||
var sTitle = col.sTitle.replace( /<.*?>/g, "" );
|
var sTitle = col.sTitle.replace( /<.*?>/g, "" );
|
||||||
var jqTh = $(col.nTh).removeAttr('aria-sort');
|
var th = col.nTh;
|
||||||
|
|
||||||
|
// IE7 is throwing an error when setting these properties with jQuery's
|
||||||
|
// attr() and removeAttr() methods...
|
||||||
|
th.removeAttribute('aria-sort');
|
||||||
|
|
||||||
/* In ARIA only the first sorting column can be marked as sorting - no multi-sort option */
|
/* In ARIA only the first sorting column can be marked as sorting - no multi-sort option */
|
||||||
if ( col.bSortable ) {
|
if ( col.bSortable ) {
|
||||||
if ( aSort.length > 0 && aSort[0].col == i ) {
|
if ( aSort.length > 0 && aSort[0].col == i ) {
|
||||||
jqTh.attr('aria-sort', aSort[0].dir=="asc" ? "ascending" : "descending" );
|
th.setAttribute('aria-sort', aSort[0].dir=="asc" ? "ascending" : "descending" );
|
||||||
nextSort = asSorting[ aSort[0].index+1 ] || asSorting[0];
|
nextSort = asSorting[ aSort[0].index+1 ] || asSorting[0];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -4373,7 +4377,7 @@
|
|||||||
label = sTitle;
|
label = sTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
jqTh.attr('aria-label', label);
|
th.setAttribute('aria-label', label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user