From fe7d64e0efed3670248759b8be1ef00c27ee1ee5 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 15 Jan 2014 09:36:02 +0000 Subject: [PATCH] Dev: API fixes for IE8- - IE8- requires that Function.prototype.apply be used with an array or arguments object as the second parameter - it being "array-like" isn't good enough. - This fixes DataTables/DataTables #262 --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index 53dcf783..df1ff7c9 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -49be4d755162e49ae871b2ad1f42b7706274f538 +f06ee8a003374ac5653079a2fc2587e496f7480f diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 7047a8a1..0a58f2a7 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -6318,8 +6318,6 @@ var __arrayProto = Array.prototype; - - /** * Abstraction for `context` parameter of the `Api` constructor to allow it to * take several different forms for ease of use. @@ -6369,7 +6367,7 @@ return jq.map( function(i) { idx = $.inArray( this, tables ); return idx !== -1 ? settings[idx] : null; - } ); + } ).toArray(); } }; @@ -6458,7 +6456,7 @@ // Initial data if ( data ) { - this.push.apply( this, data ); + this.push.apply( this, data.toArray ? data.toArray() : data ); } // selector @@ -6532,7 +6530,7 @@ flatten: function () { var a = []; - return new _Api( this.context, a.concat.apply( a, this ) ); + return new _Api( this.context, a.concat.apply( a, this.toArray() ) ); }, @@ -6758,8 +6756,6 @@ }; - - _Api.extend = function ( scope, obj, ext ) { // Only extend API instances and static properties of the API @@ -7544,7 +7540,7 @@ // Return an Api.rows() extended instance, so rows().nodes() etc can be used var modRows = this.rows( -1 ); modRows.pop(); - modRows.push.apply( modRows, newRows ); + modRows.push.apply( modRows, newRows.toArray() ); return modRows; } );