1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-11-29 11:24:10 +01:00

Internal - Small change to the new order() method to remove redundant code

This commit is contained in:
Allan Jardine 2013-04-20 12:04:18 +01:00
parent 2e278b0285
commit a077d24e6a
2 changed files with 2 additions and 10 deletions

View File

@ -7644,14 +7644,10 @@
// Simple column / direction passed in
order = [ [ order, dir ] ];
}
else if ( arguments.length > 1 ) {
else if ( ! $.isArray( order[0] ) ) {
// Arguments passed in (list of 1D arrays)
order = Array.prototype.slice.call( arguments );
}
else if ( ! $.isArray( order[0] ) ) {
// Just a 1D array passed in, convert to 2D to use for sorting
order = [ order ];
}
// otherwise a 2D array was passed in
return this.tables( function ( settings ) {

View File

@ -48,14 +48,10 @@ _Api.register( 'order()', function ( order, dir ) {
// Simple column / direction passed in
order = [ [ order, dir ] ];
}
else if ( arguments.length > 1 ) {
else if ( ! $.isArray( order[0] ) ) {
// Arguments passed in (list of 1D arrays)
order = Array.prototype.slice.call( arguments );
}
else if ( ! $.isArray( order[0] ) ) {
// Just a 1D array passed in, convert to 2D to use for sorting
order = [ order ];
}
// otherwise a 2D array was passed in
return this.tables( function ( settings ) {