Skip to content

Commit

Permalink
New Sheetsee
Browse files Browse the repository at this point in the history
  • Loading branch information
jlord committed Mar 29, 2017
1 parent 6473fcf commit 5174e18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/sheetsee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -15297,4 +15297,4 @@ support.funcNames = typeof Function.name == 'string';
module.exports = support;

},{"lodash._renative":18}]},{},[8])
;
;

This comment was marked as resolved.

Copy link
@FISH-Cyrus

1 comment on commit 5174e18

@stillhated
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not adjust keys. isnt that part of the security?

Please sign in to comment.