From 73d36854e3fe1507aa3c1a7a7505ce06a141ebd1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 25 May 2013 08:12:44 +0100 Subject: [PATCH] Dev fix: Fix flatten, which was returning an array rather than an API instance --- media/src/api/api.base.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media/src/api/api.base.js b/media/src/api/api.base.js index 2b813a38..801a3ea0 100644 --- a/media/src/api/api.base.js +++ b/media/src/api/api.base.js @@ -309,9 +309,11 @@ _Api.prototype = /** @lends DataTables.Api */{ flatten: function () { - return this.reduce( function ( a, b ) { + var a = this.reduce( function ( a, b ) { return a.concat( b ); } ); + + return new _Api( this.context, a ); }, @@ -436,6 +438,7 @@ _Api.prototype = /** @lends DataTables.Api */{ push: _arrayProto.push, + // Does not return an API instance reduce: _arrayProto.reduce || function ( fn, init ) { var