UI: allow copy&pasting lat,lon into the lat search field

This commit is contained in:
marc tobias
2017-10-21 14:11:46 +02:00
parent cc785ccad0
commit 3cee2d185d
2 changed files with 9 additions and 1 deletions

View File

@@ -248,6 +248,14 @@ jQuery(document).on('ready', function(){
highlight_result(0, false);
// common mistake is to copy&paste latitude and longitude into the 'lat' search box
$('form input[name=lat]').on('change', function(){
var coords = $(this).val().split(',');
if (coords.length == 2) {
$(this).val(coords[0]);
$(this).siblings('input[name=lon]').val(coords[1]);
}
});
});