git-svn-id: https://msi/svn/firstRepo/WebClient/branches/NewRelease@52 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -15,7 +15,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
|
||||
events: {
|
||||
"click #saveBtn": "saveBtn",
|
||||
"change #spacc-PMChk": "spaccPMClick"
|
||||
"change #spacc-PMChk": "spaccPMClick",
|
||||
"change #stato": "statoChange"
|
||||
},
|
||||
|
||||
statoChange: function(){
|
||||
if(this.$el.find('#stato').val() !== "ITALIA")
|
||||
{
|
||||
this.$el.find('#provTxt').parent().show();
|
||||
this.$el.find('#prov').parent().hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$el.find('#provTxt').parent().hide();
|
||||
this.$el.find('#prov').parent().show();
|
||||
}
|
||||
},
|
||||
|
||||
saveBtn:function(e){
|
||||
@@ -34,13 +48,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
if(Profile.data.isSpacc==="1")
|
||||
{
|
||||
Profile.data.email = this.$el.find('#email').val();
|
||||
Profile.data.dataSpacc.provincia = this.$el.find('#prov').val();
|
||||
Profile.data.dataSpacc.stato = this.$el.find('#stato').val();
|
||||
if(this.$el.find('#stato').val() !== "ITALIA"){
|
||||
Profile.data.dataSpacc.provincia = this.$el.find('#provTxt').val();
|
||||
}
|
||||
else{
|
||||
Profile.data.dataSpacc.provincia = this.$el.find('#prov').val();
|
||||
}
|
||||
|
||||
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.privacy = this.$el.find('#privacyChk').prop('checked')?"1":"0";
|
||||
|
||||
if(Profile.data.email === "" ||
|
||||
Profile.data.dataSpacc.stato === "" ||
|
||||
Profile.data.dataSpacc.provincia === "" ||
|
||||
Profile.data.dataSpacc.comune === "" ||
|
||||
Profile.data.dataSpacc.cap === "" ||
|
||||
@@ -66,7 +88,7 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
url: "http://maps.google.com/maps/api/geocode/json?address=" +
|
||||
Profile.data.dataSpacc.comune + "+" +
|
||||
Profile.data.dataSpacc.comune + "+" +
|
||||
Profile.data.dataSpacc.provincia + "+italia&sensor=false",
|
||||
Profile.data.dataSpacc.provincia + "+" + Profile.data.dataSpacc.stato + "&sensor=false",
|
||||
Type: "GET"
|
||||
}).then(function ( response ) {
|
||||
if(response.results.length == 1)
|
||||
@@ -111,7 +133,21 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
else
|
||||
this.$el.find('#mapSpacc > :not(.ui-checkbox:has(#spacc-PMChk))').show();
|
||||
|
||||
if(this.$el.find('#stato').val() !== "ITALIA")
|
||||
{
|
||||
this.$el.find('#provTxt').parent().show();
|
||||
this.$el.find('#prov').parent().hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$el.find('#provTxt').parent().hide();
|
||||
this.$el.find('#prov').parent().show();
|
||||
}
|
||||
|
||||
$( "#autocomplete_comune" ).on( "filterablebeforefilter", function ( e, data ) {
|
||||
if(self.$el.find('#stato').val() !== "ITALIA")
|
||||
return;
|
||||
|
||||
var $ul = $( this ),
|
||||
$input = $( data.input ),
|
||||
value = $input.val(),
|
||||
@@ -163,12 +199,26 @@ define(['jquery', 'underscore', 'backbone','text!modules/settings/settingsViewTe
|
||||
this.$el.append(this.template());
|
||||
this.$el.append(this.footer.$el);
|
||||
}
|
||||
|
||||
this.$el.find('#nResult').val(Profile.data.risRic);
|
||||
this.$el.find('#theme').val(Profile.data.tema);
|
||||
|
||||
this.$el.find('#spacc-PMChk').prop('checked', Profile.data.isSpacc==="0"?false:true);
|
||||
this.$el.find('#email').val(Profile.data.email);
|
||||
this.$el.find('#prov').val(Profile.data.dataSpacc.provincia);
|
||||
this.$el.find('#stato').val(Profile.data.dataSpacc.stato);
|
||||
if(this.$el.find('#stato').val() !== "ITALIA")
|
||||
{
|
||||
this.$el.find('#provTxt').parent().show();
|
||||
this.$el.find('#prov').parent().hide();
|
||||
this.$el.find('#provTxt').val(Profile.data.dataSpacc.provincia);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$el.find('#provTxt').parent().hide();
|
||||
this.$el.find('#prov').parent().show();
|
||||
this.$el.find('#prov').val(Profile.data.dataSpacc.provincia);
|
||||
}
|
||||
|
||||
this.$el.find('#comune').val(Profile.data.dataSpacc.comune);
|
||||
this.$el.find('#CAP').val(Profile.data.dataSpacc.cap);
|
||||
this.$el.find('#tPM').val(Profile.data.dataSpacc.tipopm);
|
||||
|
||||
Reference in New Issue
Block a user