Fix - sorting: Absolute sorting didn't consider the case of the two items being compared both being in the "always" sorting categories.

- Thanks to awelch for this fix!
pull/384/head
Allan Jardine 7 years ago
parent 0f84a1c915
commit 71ba75d2f5

@ -98,7 +98,13 @@ var _setup = function ( values ) {
// Ascending ordering method // Ascending ordering method
o.asc = function ( a, b, isNumber ) { o.asc = function ( a, b, isNumber ) {
if ( o.alwaysTop[ a ] || o.alwaysBottom[ b ] ) { if ( o.alwaysTop[ a ] && o.alwaysTop[ b ] ) {
return 0;
}
else if ( o.alwaysBottom[ a ] && o.alwaysBottom[ b ] ) {
return 0;
}
else if ( o.alwaysTop[ a ] || o.alwaysBottom[ b ] ) {
return -1; return -1;
} }
else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) { else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) {
@ -120,7 +126,13 @@ var _setup = function ( values ) {
// Descending ordering method // Descending ordering method
o.desc = function ( a, b, isNumber ) { o.desc = function ( a, b, isNumber ) {
if ( o.alwaysTop[ a ] || o.alwaysBottom[ b ] ) { if ( o.alwaysTop[ a ] && o.alwaysTop[ b ] ) {
return 0;
}
else if ( o.alwaysBottom[ a ] && o.alwaysBottom[ b ] ) {
return 0;
}
else if ( o.alwaysTop[ a ] || o.alwaysBottom[ b ] ) {
return -1; return -1;
} }
else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) { else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) {

Loading…
Cancel
Save