Fix PTA webservice: visibility, friends, address, phone, job, diploma.
[platal.git] / htdocs / javascript / profile.js
index 0d63c9b..b8b1c2c 100644 (file)
@@ -317,8 +317,13 @@ function addressChanged(prefid, color)
     var text = $('#' + prefid + '_cont').find("[name*='[text]']").val();
     $('#' + prefid + '_cont').find('[name*=changed]').val("1");
     $.xpost('map_url/', { text:text, color:color }, function(data) {
-        $('#' + prefid + '_static_map_url').show();
-        $('#' + prefid + '_static_map_url').find('img').attr('src', data);
+        if (data) {
+            $('#' + prefid + '_static_map_url').show();
+            $('#' + prefid + '_static_map_url').find('img').attr('src', data);
+        } else {
+            $('#' + prefid + '_static_map_url').hide();
+            $('#' + prefid + '_geocoding_removal').find('[name*=request]:checkbox').removeAttr('checked');
+        }
     });
 }