1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-19 17:54:14 +01:00

Dev fix: The flatten() method should only flatten 2D arrays, and not

1D arrays.

- The method implemented isn't actually 100% perfect - if you mix arrays
  and scalars, then the behaviour is undefined. But that shouldn't
  happen in DataTables. Will look into it further, though
This commit is contained in:
Allan Jardine 2013-12-28 17:05:11 +00:00
parent e699f8b510
commit e5d8a40fc1
2 changed files with 6 additions and 4 deletions

View File

@ -1 +1 @@
e36896eb799e0f3f1173ce3558bca8a8d222a08f
24c30064ce0ef343caf702b3df0de7b4b96d1d1b

View File

@ -6521,9 +6521,11 @@
flatten: function ()
{
var a = this.reduce( function ( a, b ) {
return a.concat( b );
} );
var a = this.length && $.isArray( this[0] ) ?
this.reduce( function ( a, b ) {
return a.concat( b );
} ) :
this;
return new _Api( this.context, a );
},