git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@58 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -59,6 +59,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
Profile.data.dataSpacc.comune = this.$el.find('#comune').val();
|
||||
Profile.data.dataSpacc.cap = this.$el.find('#CAP').val();
|
||||
Profile.data.dataSpacc.tipopm = this.$el.find('#tPM').val();
|
||||
Profile.data.dataSpacc.note = this.$el.find('#note').val();
|
||||
Profile.data.dataSpacc.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
|
||||
|
||||
if(Profile.data.email === "" ||
|
||||
@@ -87,21 +88,28 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
$.ajax({
|
||||
url: "http://maps.google.com/maps/api/geocode/json?address=" +
|
||||
Profile.data.dataSpacc.comune + "+" +
|
||||
Profile.data.dataSpacc.comune + "+" +
|
||||
Profile.data.dataSpacc.cap + "+" +
|
||||
Profile.data.dataSpacc.provincia + "+" + Profile.data.dataSpacc.stato + "&sensor=false",
|
||||
Type: "GET"
|
||||
}).then(function ( response ) {
|
||||
if(response.results.length == 1)
|
||||
{
|
||||
Profile.data.dataSpacc.lat = response.results[0].geometry.location.lat;
|
||||
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
||||
Profile.updateProfile(function(){
|
||||
self._flagSave = false;
|
||||
self.$el.find('#titlePopup').html("Salvataggio");
|
||||
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
||||
self.$el.find('#popupDialog').popup("open");
|
||||
});
|
||||
Profile.data.dataSpacc.long = response.results[0].geometry.location.lng;
|
||||
}
|
||||
|
||||
if(Profile.data.dataSpacc.lat === "" &&
|
||||
Profile.data.dataSpacc.long === ""){
|
||||
self._flagSave = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Profile.updateProfile(function(){
|
||||
self._flagSave = false;
|
||||
self.$el.find('#titlePopup').html("Salvataggio");
|
||||
self.$el.find('#messaggio').html("Impostazioni salvate con successo");
|
||||
self.$el.find('#popupDialog').popup("open");
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -162,7 +170,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
})
|
||||
.then( function ( response ) {
|
||||
$.each( response, function ( i, val ) {
|
||||
html += "<li>" + val.Comune + "<input id='hdnCAP" + i + "'' type='hidden' value='" + val.CAP + "'></li>";
|
||||
html += "<li>" + unescape(val.Comune) + "<input id='hdnCAP" + i + "'' type='hidden' value='" + val.CAP + "'></li>";
|
||||
});
|
||||
$ul.html( html );
|
||||
$ul.listview( "refresh" );
|
||||
@@ -221,6 +229,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
|
||||
this.$el.find('#comune').val(Profile.data.dataSpacc.comune);
|
||||
this.$el.find('#CAP').val(Profile.data.dataSpacc.cap);
|
||||
this.$el.find('#note').val(Profile.data.dataSpacc.note);
|
||||
this.$el.find('#tPM').val(Profile.data.dataSpacc.tipopm);
|
||||
this.$el.find('#privacyChk').prop('checked', Profile.data.dataSpacc.privacy==="0"?false:true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user