From: Anton Khorev Date: Sun, 11 Aug 2024 04:03:01 +0000 (+0300) Subject: Move empty value check out of endpoint.getGeocode X-Git-Tag: live~306^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/51cbbe6d5a86eaf34d507ab6e666772e2ffa439c Move empty value check out of endpoint.getGeocode --- diff --git a/app/assets/javascripts/index/directions-endpoint.js b/app/assets/javascripts/index/directions-endpoint.js index ec09352de..066542707 100644 --- a/app/assets/javascripts/index/directions-endpoint.js +++ b/app/assets/javascripts/index/directions-endpoint.js @@ -43,18 +43,12 @@ OSM.DirectionsEndpoint = function Endpoint(map, input, iconUrl, dragCallback, ch setLatLng(latlng); setInputValueFromLatLng(latlng); changeCallback(); - } else { + } else if (endpoint.value) { endpoint.getGeocode(); } }; endpoint.getGeocode = function () { - // if no one has entered a value yet, then we can't geocode, so don't - // even try. - if (!endpoint.value) { - return; - } - endpoint.awaitingGeocode = true; var viewbox = map.getBounds().toBBoxString(); // ,,,