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:
parent
e699f8b510
commit
e5d8a40fc1
@ -1 +1 @@
|
||||
e36896eb799e0f3f1173ce3558bca8a8d222a08f
|
||||
24c30064ce0ef343caf702b3df0de7b4b96d1d1b
|
||||
|
8
media/js/jquery.dataTables.js
vendored
8
media/js/jquery.dataTables.js
vendored
@ -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 );
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user