1
0
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:
Allan Jardine 2013-06-19 16:43:12 +01:00
parent d2755c4037
commit 0142172027

View File

@ -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;
}