From 5174e18e8e0e694cd0cc148d7adfba18490eb17b Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 29 Mar 2017 20:01:16 +0100 Subject: [PATCH] New Sheetsee --- js/sheetsee.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/sheetsee.js b/js/sheetsee.js index 4107c21..ea4cd22 100644 --- a/js/sheetsee.js +++ b/js/sheetsee.js @@ -14288,7 +14288,7 @@ function perpareSort (event) { if (!tblOpts.sortMeta.sorted || tblOpts.sortMeta.sorted === 'descending') { tblOpts.sortMeta.sorted = 'ascending' } else if (tblOpts.sortMeta.sorted === 'ascending') tblOpts.sortMeta.sorted = 'descending' - + // TODO maybe make all keys in data lowercase... tblOpts.sortMeta.sortBy = event.target.innerHTML.replace(/\s/g, '').replace(/\W/g, '') tblOpts.tableDiv = '#' + event.target.closest('div').getAttribute('id') sortData() @@ -14303,8 +14303,8 @@ function sortData () { sortGroup.sort(function (a, b) { var aa = a[tblOpts.sortMeta.sortBy].toLowerCase() var bb = b[tblOpts.sortMeta.sortBy].toLowerCase() - aa = aa.match(/^[\d\.,]$/) ? Number(aa) : aa - bb = bb.match(/^[\d\.,]$/) ? Number(bb) : bb + aa = aa.match(/^[\d,]$/) ? Number(aa) : aa + bb = bb.match(/^[\d,]$/) ? Number(bb) : bb if (aa < bb) return -1 if (aa > bb) return 1 @@ -15297,4 +15297,4 @@ support.funcNames = typeof Function.name == 'string'; module.exports = support; },{"lodash._renative":18}]},{},[8]) -; +; \ No newline at end of file