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 6 years ago
parent 0f84a1c915
commit 71ba75d2f5

@ -98,7 +98,13 @@ var _setup = function ( values ) {
// Ascending ordering method
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;
}
else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) {
@ -120,7 +126,13 @@ var _setup = function ( values ) {
// Descending ordering method
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;
}
else if ( o.alwaysBottom[ a ] || o.alwaysTop[ b ] ) {

Loading…
Cancel
Save