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

Fix: Language backwards compatibility could override developer defined defaults - 9267

This commit is contained in:
Allan Jardine 2012-03-30 15:30:19 +01:00
parent e815062197
commit c1e40a8596
2 changed files with 8 additions and 4 deletions

View File

@ -2578,13 +2578,15 @@
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
* sZeroRecords - assuming that is given.
*/
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords )
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
oDefaults.sEmptyTable === "No data available in table" )
{
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
}
/* Likewise with loading records */
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords )
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
oDefaults.sLoadingRecords === "Loading..." )
{
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
}

View File

@ -135,13 +135,15 @@ function _fnLanguageCompat( oLanguage )
/* Backwards compatibility - if there is no sEmptyTable given, then use the same as
* sZeroRecords - assuming that is given.
*/
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords )
if ( !oLanguage.sEmptyTable && oLanguage.sZeroRecords &&
oDefaults.sEmptyTable === "No data available in table" )
{
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sEmptyTable' );
}
/* Likewise with loading records */
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords )
if ( !oLanguage.sLoadingRecords && oLanguage.sZeroRecords &&
oDefaults.sLoadingRecords === "Loading..." )
{
_fnMap( oLanguage, oLanguage, 'sZeroRecords', 'sLoadingRecords' );
}