1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-19 12:52:11 +01:00

Update media/src/core/core.info.js

Only set iStart once and only call fnFormatNumber once on iStart.
This commit is contained in:
Tim Tucker 2012-09-30 10:21:09 -03:00
parent 6b605936f7
commit 473e9b0088

View File

@ -1,4 +1,3 @@
/**
* Generate the node required for the info display
* @param {object} oSettings dataTables settings object
@ -85,8 +84,10 @@ function _fnUpdateInfo ( oSettings )
function _fnInfoMacros ( oSettings, str )
{
// When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
// internally
var
iStart = oSettings._iDisplayStart+1,
iStart = oSettings.oScroll.bInfinite ? 1 : oSettings._iDisplayStart+1,
sStart = oSettings.fnFormatNumber( iStart ),
iEnd = oSettings.fnDisplayEnd(),
sEnd = oSettings.fnFormatNumber( iEnd ),
@ -95,13 +96,6 @@ function _fnInfoMacros ( oSettings, str )
iMax = oSettings.fnRecordsTotal(),
sMax = oSettings.fnFormatNumber( iMax );
// When infinite scrolling, we are always starting at 1. _iDisplayStart is used only
// internally
if ( oSettings.oScroll.bInfinite )
{
sStart = oSettings.fnFormatNumber( 1 );
}
return str.
replace(/_START_/g, sStart).
replace(/_END_/g, sEnd).