Fix '<City>, <Country>' splitting (#84)

This commit is contained in:
alexey-zakharenkov 2019-11-21 16:21:51 +03:00 committed by Rostislav
parent 6aec8df2a0
commit 672cdcf9f4
2 changed files with 4 additions and 2 deletions

View file

@ -66,7 +66,9 @@ L.CitySelect = L.Control.extend({
}
for (var i = 0; i < cities.length; i++) {
city_name = cities[i].split(',')[0];
// Remove country name which follows last comma and doesn't contain commas itself
var last_comma_index = cities[i].lastIndexOf(',');
var city_name = cities[i].substring(0, last_comma_index);
content += '<option value="' + city_name + '">' + cities[i] + '</option>';
}

View file

@ -158,7 +158,7 @@ COUNTRY_CITY = '''
</div><div class="warnings">
{warnings}
</div>
</td></td>
</td></tr>
'''
COUNTRY_FOOTER = '''