From 51cbbe6d5a86eaf34d507ab6e666772e2ffa439c Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Sun, 11 Aug 2024 07:03:01 +0300 Subject: [PATCH] Move empty value check out of endpoint.getGeocode --- app/assets/javascripts/index/directions-endpoint.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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(); // ,,, -- 2.39.5