From 9352d72829f1b80879994391b71ae1d25e264a29 Mon Sep 17 00:00:00 2001 From: Matteo Barison Date: Fri, 5 Nov 2021 09:17:41 +0100 Subject: [PATCH] Fix saving location components in map.js (#2099) --- assets/scripts/map.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/scripts/map.js b/assets/scripts/map.js index 16d39df0f17..09bbe54eec6 100644 --- a/assets/scripts/map.js +++ b/assets/scripts/map.js @@ -398,13 +398,13 @@ function getInfoToStore(name, lat, lng, city, state, country, postal){ var boycott = $("#boycott_"+name).val(); // 2 - city; 3 - state; 4 - country; 5 - postal - if (boycott.indexOf("2")!=-1) + if (boycott.indexOf("2")===-1) city = ''; - if (boycott.indexOf("3")!=-1) + if (boycott.indexOf("3")===-1) state = ''; - if (boycott.indexOf("4")!=-1) + if (boycott.indexOf("4")===-1) country = ''; - if (boycott.indexOf("5")!=-1) + if (boycott.indexOf("5")===-1) postal = ''; $("#answer"+name).val(lat + ';' + lng + ';' + city + ';' + state + ';' + country + ';' + postal);