From d2b6ad6e01bfb599cea25fef2df0b73ee6b45140 Mon Sep 17 00:00:00 2001 From: berkas1 <berka@berkasimon.com> Date: Mon, 31 May 2021 16:55:50 +0200 Subject: [PATCH] fix sorttable.js to consider Unlimited as high number --- assets/js/sorttable.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/sorttable.js b/assets/js/sorttable.js index 38b0fc6..b334e4f 100644 --- a/assets/js/sorttable.js +++ b/assets/js/sorttable.js @@ -260,12 +260,14 @@ sorttable = { you are comparing a[0] and b[0] */ sort_numeric: function(a,b) { aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; + if (isNaN(aa)) aa = 1000000; bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; + if (isNaN(bb)) bb = 1000000; return aa-bb; }, sort_alpha: function(a,b) { + if (a[0] == "Unlimited") { a[0] = 1000000} + if (b[0] == "Unlimited") { b[0] = 1000000} if (a[0]==b[0]) return 0; if (a[0]<b[0]) return -1; return 1; -- GitLab