1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

Dev: Modify the API extender to remove a potential closure issue

Dev: Modify the initialisation of _Api - the old method of using `=`
twice on a row caused Chrome's debugger to show it as both names
concatinated which was confusing.

Fix: Remove API "build" code. That was part of the API prototype and the
design moved away from that approach. The code was redundant and unused.
This commit is contained in:
Allan Jardine 2014-06-18 12:23:31 +01:00
parent 6b12300c69
commit 097f45855f
2 changed files with 5 additions and 9 deletions

View File

@ -1 +1 @@
92d5bd399c119ff7fd2579b054dbeea0bb15806c
56e4fd1cdbaddc9b9ca4d4788c88640caa7db1e3

View File

@ -6500,7 +6500,7 @@
* // Initialisation as a constructor
* var api = new $.fn.DataTable.Api( 'table.dataTable' );
*/
DataTable.Api = _Api = function ( context, data )
_Api = function ( context, data )
{
if ( ! this instanceof _Api ) {
throw 'DT API must be constructed as a new object';
@ -6543,6 +6543,7 @@
_Api.extend( this, this, __apiStruct );
};
DataTable.Api = _Api;
_Api.prototype = /** @lends DataTables.Api */{
/**
@ -6810,7 +6811,7 @@
i, ien,
j, jen,
struct, inner,
methodScoping = function ( fn, struc ) {
methodScoping = function ( scope, fn, struc ) {
return function () {
var ret = fn.apply( scope, arguments );
@ -6825,7 +6826,7 @@
// Value
obj[ struct.name ] = typeof struct.val === 'function' ?
methodScoping( struct.val, struct ) :
methodScoping( scope, struct.val, struct ) :
$.isPlainObject( struct.val ) ?
{} :
struct.val;
@ -6921,11 +6922,6 @@
src.propExt;
}
}
// Rebuild the API with the new construct
if ( _Api.ready ) {
DataTable.api.build();
}
};