mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-19 08:18:05 +02:00
Zone selector sorting vs uppercases
This makes the sorting of the Zone in the Zone selector with the uppercase grouped with the lowercase for a same letter but uppercase always first. (Note: Accented char are considered as a different letter. We would need to support exception cases for all the existing charsets. These are only entities descriptors, not really for literature.)
This commit is contained in:
parent
b7393b2398
commit
0b330dfcd6
1 changed files with 14 additions and 11 deletions
|
@ -2905,21 +2905,24 @@ function getExistingZoneList() {
|
|||
};
|
||||
listExistingZones.push(thisZone);
|
||||
}
|
||||
listExistingZones.sort(zoneSortOrder());
|
||||
listExistingZones.sort(zoneSortOrder);
|
||||
return listExistingZones;
|
||||
}
|
||||
|
||||
function zoneSortOrder() {
|
||||
return function(a, b) {
|
||||
var nameA = a.name.toUpperCase();
|
||||
var nameB = b.name.toUpperCase();
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
} else if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
function zoneSortOrder(a, b) {
|
||||
var nameA = a.name.toUpperCase();
|
||||
var nameB = b.name.toUpperCase();
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
} else if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
} else if (a.name < b.name) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue