mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-28 01:54:15 +01:00
Internal - Small change to the new order() method to remove redundant code
This commit is contained in:
parent
2e278b0285
commit
a077d24e6a
6
media/js/jquery.dataTables.js
vendored
6
media/js/jquery.dataTables.js
vendored
@ -7644,14 +7644,10 @@
|
|||||||
// Simple column / direction passed in
|
// Simple column / direction passed in
|
||||||
order = [ [ order, dir ] ];
|
order = [ [ order, dir ] ];
|
||||||
}
|
}
|
||||||
else if ( arguments.length > 1 ) {
|
else if ( ! $.isArray( order[0] ) ) {
|
||||||
// Arguments passed in (list of 1D arrays)
|
// Arguments passed in (list of 1D arrays)
|
||||||
order = Array.prototype.slice.call( arguments );
|
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
|
// otherwise a 2D array was passed in
|
||||||
|
|
||||||
return this.tables( function ( settings ) {
|
return this.tables( function ( settings ) {
|
||||||
|
@ -48,14 +48,10 @@ _Api.register( 'order()', function ( order, dir ) {
|
|||||||
// Simple column / direction passed in
|
// Simple column / direction passed in
|
||||||
order = [ [ order, dir ] ];
|
order = [ [ order, dir ] ];
|
||||||
}
|
}
|
||||||
else if ( arguments.length > 1 ) {
|
else if ( ! $.isArray( order[0] ) ) {
|
||||||
// Arguments passed in (list of 1D arrays)
|
// Arguments passed in (list of 1D arrays)
|
||||||
order = Array.prototype.slice.call( arguments );
|
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
|
// otherwise a 2D array was passed in
|
||||||
|
|
||||||
return this.tables( function ( settings ) {
|
return this.tables( function ( settings ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user