mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-18 18:48:47 +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,12 +2905,11 @@ function getExistingZoneList() {
|
||||||
};
|
};
|
||||||
listExistingZones.push(thisZone);
|
listExistingZones.push(thisZone);
|
||||||
}
|
}
|
||||||
listExistingZones.sort(zoneSortOrder());
|
listExistingZones.sort(zoneSortOrder);
|
||||||
return listExistingZones;
|
return listExistingZones;
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoneSortOrder() {
|
function zoneSortOrder(a, b) {
|
||||||
return function(a, b) {
|
|
||||||
var nameA = a.name.toUpperCase();
|
var nameA = a.name.toUpperCase();
|
||||||
var nameB = b.name.toUpperCase();
|
var nameB = b.name.toUpperCase();
|
||||||
if (nameA > nameB) {
|
if (nameA > nameB) {
|
||||||
|
@ -2918,8 +2917,12 @@ function zoneSortOrder() {
|
||||||
} else if (nameA < nameB) {
|
} else if (nameA < nameB) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
if (a.name > b.name) {
|
||||||
|
return 1;
|
||||||
|
} else if (a.name < b.name) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}()); // END LOCAL_SCOPE
|
}()); // END LOCAL_SCOPE
|
||||||
|
|
Loading…
Reference in a new issue