diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/script.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/data/script.js b/data/script.js index 7e8bef3..9d7354e 100644 --- a/data/script.js +++ b/data/script.js @@ -5,7 +5,9 @@ $(document).ready (function () { items.detach ().sort (function (nodeA, nodeB) { var a = $(nodeA).data (by); var b = $(nodeB).data (by); - if (typeof a == 'number' || typeof b == 'number') { + if (by == 'rank') { + a = parseFloat (a); + b = parseFloat (b); return a > b ? 1 : (a < b ? -1 : 0); } else { return a.localeCompare (b); |