mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
Dev fix: The sort classes were being applied regardless of sort
and
`sortClasses`
This commit is contained in:
parent
d2755c4037
commit
0142172027
@ -313,6 +313,9 @@ function _fnSortingClasses( settings )
|
||||
var classes = settings.oClasses;
|
||||
var sortIcon = classes.sSortIcon;
|
||||
var sort = _fnSortFlatten( settings );
|
||||
var features = settings.oFeatures;
|
||||
var sortFeature = features.bSort;
|
||||
var sortClasses = features.bSortClasses;
|
||||
var i, ien, col, colIdx, jqTh;
|
||||
|
||||
// Remove old sorting classes
|
||||
@ -344,11 +347,14 @@ function _fnSortingClasses( settings )
|
||||
}
|
||||
|
||||
// Remove column sorting
|
||||
if ( sortClasses ) {
|
||||
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
||||
.removeClass( classes.sSortColumn + (i<2 ? i+1 : 3) );
|
||||
}
|
||||
}
|
||||
|
||||
// Add new ones
|
||||
if ( sortFeature ) {
|
||||
for ( i=0, ien=sort.length ; i<ien ; i++ ) {
|
||||
colIdx = sort[i].col;
|
||||
col = columns[ colIdx ];
|
||||
@ -371,9 +377,12 @@ function _fnSortingClasses( settings )
|
||||
}
|
||||
|
||||
// Add column sorting
|
||||
if ( sortClasses ) {
|
||||
$( _pluck( settings.aoData, 'anCells', colIdx ) )
|
||||
.addClass( classes.sSortColumn + (i<2 ? i+1 : 3) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settings.aLastSort = sort;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user