mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-19 12:52:11 +01:00
Update media/src/core/core.sort.js
Further refinement - stop once all sorting classes have been seen
This commit is contained in:
parent
2afa5e4360
commit
6bce847a3b
@ -404,7 +404,7 @@ function _fnSortingClasses( oSettings )
|
|||||||
|
|
||||||
/* Remove the old classes */
|
/* Remove the old classes */
|
||||||
if ( oSettings.oFeatures.bDeferRender || nTds.length >= iColumns )
|
if ( oSettings.oFeatures.bDeferRender || nTds.length >= iColumns )
|
||||||
{
|
{
|
||||||
var reClass = new RegExp(sClass + "[123]");
|
var reClass = new RegExp(sClass + "[123]");
|
||||||
|
|
||||||
/* Track columns where we've found one of the sorting classes */
|
/* Track columns where we've found one of the sorting classes */
|
||||||
@ -418,15 +418,21 @@ function _fnSortingClasses( oSettings )
|
|||||||
/* Check if we've already found the class at least once in this column
|
/* Check if we've already found the class at least once in this column
|
||||||
*
|
*
|
||||||
* If not, check the className of this cell
|
* If not, check the className of this cell
|
||||||
|
*
|
||||||
|
* Stop once we've found all 3 sorting classes
|
||||||
*/
|
*/
|
||||||
abFound[iTargetCol] = abFound[iTargetCol] || ( nTds[i].className.indexOf(sClass) !== -1 );
|
if (abFound.length < 3)
|
||||||
|
{
|
||||||
|
abFound[iTargetCol] |= nTds[i].className.indexOf(sClass) !== -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ( abFound[iTargetCol] )
|
if ( abFound[iTargetCol] )
|
||||||
{
|
{
|
||||||
nTds[i].className =
|
nTds[i].className =
|
||||||
$.trim( nTds[i].className.replace( reClass, "" ) );
|
$.trim( nTds[i].className.replace( reClass, "" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add the new classes to the table */
|
/* Add the new classes to the table */
|
||||||
var iClass = 1, iTargetCol;
|
var iClass = 1, iTargetCol;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user