Skip to content

Commit

Permalink
Update sortable.js
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlove committed Sep 15, 2022
1 parent bae78d4 commit 763bd9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,19 @@ function sortable(selectors, options) {
aCellContent = aCellContent.split('.').map(n => +n+100000).join('.');
bCellContent = bCellContent.split('.').map(n => +n+100000).join('.');
if (direction == 'ascending') {
return (aCellContent > bCellContent) ? 1 : -1;
return aCellContent.localeCompare(bCellContent);
} else {
return (aCellContent > bCellContent) ? -1 : 0;
return bCellContent.localeCompare(aCellContent);
}
break;
default:
th.classList.add(...options.sortStringClasses);
aCell.classList.add(...options.sortStringClasses);
bCell.classList.add(...options.sortStringClasses);
if (direction == 'ascending') {
return (aCellContent > bCellContent) ? 1 : -1;
return aCellContent.localeCompare(bCellContent);
} else {
return (aCellContent > bCellContent) ? -1 : 0;
return bCellContent.localeCompare(aCellContent);
}
}

Expand Down

0 comments on commit 763bd9b

Please sign in to comment.