Skip to content

Commit

Permalink
Merge pull request #32 from evt-project/fix/list-indexes-order
Browse files Browse the repository at this point in the history
Fix sorting of items in list starting with ç. Fix #27
  • Loading branch information
EVTDevelopers authored Nov 10, 2020
2 parents 38713fd + 032197e commit 2766689
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 0 additions & 3 deletions js/main/interface_control/ic_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,6 @@ function handleListOutput(listType, listDefaultLabel, listEl, htmlEl) {
var orderListLetter = this.getAttribute('data-order-list')
if (orderListLetter) {
orderListLetter = orderListLetter.toUpperCase();
if (orderListLetter === 'Ç') {
orderListLetter = "C";
}
if (!LISTS_MODEL[listName][orderListLetter]) {
LISTS_MODEL[listName][orderListLetter] = [];
LISTS_MODEL[listName]._filterIndexes.push(orderListLetter);
Expand Down
2 changes: 2 additions & 0 deletions js/main/interface_control/ic_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ function updateKeysVisibility(listName) {
listLetters.innerHTML = '';
if (LISTS_MODEL[listName]._items && Object.keys(LISTS_MODEL[listName]._items).length >= 30) {
var orderedIndexes = LISTS_MODEL[listName]._filterIndexes.sort(function (a, b) {
a = a === 'Ç' ? 'C' : a;
b = b === 'Ç' ? 'C' : b;
if (a < b) return -1;
if (a > b) return 1;
return 0;
Expand Down

0 comments on commit 2766689

Please sign in to comment.