Skip to content

Commit

Permalink
order self.names
Browse files Browse the repository at this point in the history
  • Loading branch information
hv-leo committed Oct 30, 2015
1 parent 90fc10c commit f52709d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions js/GeoDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,6 @@ geoDropdown.prototype.geoClick = function(geo,instance,geonameid) {
$.ajax({
url: 'http://bioinformatics.ua.pt/geodropdown/geodatabase/'+geonameid+'/',
success: function(response){
if(response.length == 0) return;

// build the required data
if(self.level!=-1 || self.continent!="default_continent" || self.names.length>=165) self.names = new Array;
for(i=0;i<response.length;i++){
Expand All @@ -215,8 +213,7 @@ geoDropdown.prototype.geoClick = function(geo,instance,geonameid) {
else self.level=1;
}

// add the required data to 3D array
self.names = sorted(self.names,key=itemgetter('name'))
// add the required data to 3D array
self.levels[self.level] = self.names;

// Populate the fresh data
Expand Down

0 comments on commit f52709d

Please sign in to comment.