Skip to content

Commit

Permalink
Update GeoDropdown.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hv-leo committed Oct 31, 2015
1 parent 701512b commit b8a5457
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions js/GeoDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,16 @@ geoDropdown.prototype.geoClick = function(geo,instance,geonameid) {

// order data
self.names.sort(function(a, b) {
if(a.name < b.name) return -1;
if(a.name > b.name) return 1;
return 0;
if(self.level==1 || (self.level==-1 && self.continent=="default_continent")){
if(getCountryName(a.name) < getCountryName(b.name)) return -1;
if(getCountryName(a.name) > getCountryName(b.name)) return 1;
return 0;
}
else{
if(a.name < b.name) return -1;
if(a.name > b.name) return 1;
return 0;
}
});

// add the required data to 3D array
Expand Down

0 comments on commit b8a5457

Please sign in to comment.