1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-11-29 11:24:10 +01:00

Fix: When extending the defaults using camelCase, objects didn't work

- Issue here was that when doing the camelCase to hungarian conversion
  on objects, the user object was copying over the hungarian default.
  This meant that parameters were lost and things broke! The fix is to
  decend into the object

- See thread 20233 for the original report
This commit is contained in:
Allan Jardine 2014-04-01 11:07:47 +01:00
parent 09bf9b200c
commit 1a5e32295a
2 changed files with 6 additions and 5 deletions

View File

@ -1 +1 @@
59aab63cae6169f1a282e23c493a1f758a2ce34d
45da091f3432b78e135e090c22b4ef03fdb760a0

View File

@ -308,6 +308,7 @@
newKey = key.replace( match[0], match[2].toLowerCase() );
map[ newKey ] = key;
//console.log( key, match );
if ( match[1] === 'o' )
{
_fnHungarianMap( o[key] );
@ -332,8 +333,7 @@
*/
function _fnCamelToHungarian ( src, user, force )
{
if ( ! src._hungarianMap )
{
if ( ! src._hungarianMap ) {
_fnHungarianMap( src );
}
@ -344,12 +344,13 @@
if ( hungarianKey !== undefined && (force || user[hungarianKey] === undefined) )
{
user[hungarianKey] = user[ key ];
if ( hungarianKey.charAt(0) === 'o' )
{
_fnCamelToHungarian( src[hungarianKey], user[key] );
}
else {
src[hungarianKey] = user[ key ];
}
}
} );
}