1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

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

Simplify check for filtering / empty record set
This commit is contained in:
Tim Tucker 2012-09-03 14:02:38 -03:00
parent 59dc2aed9c
commit af5c3d8178

View File

@ -1,5 +1,4 @@
/** /**
* Generate the node required for the info display * Generate the node required for the info display
* @param {object} oSettings dataTables settings object * @param {object} oSettings dataTables settings object
@ -50,25 +49,20 @@ function _fnUpdateInfo ( oSettings )
iTotal = oSettings.fnRecordsDisplay(), iTotal = oSettings.fnRecordsDisplay(),
sOut; sOut;
if ( iTotal === 0 && iTotal == iMax ) if ( iTotal === 0 )
{ {
/* Empty record set */ /* Empty record set */
sOut = oLang.sInfoEmpty; sOut = oLang.sInfoEmpty;
} }
else if ( iTotal === 0 ) else {
{
/* Empty record set after filtering */
sOut = oLang.sInfoEmpty +' '+ oLang.sInfoFiltered;
}
else if ( iTotal == iMax )
{
/* Normal record set */ /* Normal record set */
sOut = oLang.sInfo; sOut = oLang.sInfo;
} }
else
if ( iTotal != iMax )
{ {
/* Record set after filtering */ /* Record set after filtering */
sOut = oLang.sInfo +' '+ oLang.sInfoFiltered; sOut += ' ' + oLang.sInfoFiltered;
} }
// Convert the macros // Convert the macros