Hnadle error in Lightbox API

This commit is contained in:
Romain Neutron
2012-02-17 18:48:01 +01:00
parent bb76cd8cd7
commit 68e8eb328c
3 changed files with 285 additions and 268 deletions

View File

@@ -183,12 +183,10 @@ function set_release(el)
$('.loader', el).css({ $('.loader', el).css({
visibility:'hidden' visibility:'hidden'
}); });
if(data.error) if(data.datas)
{ {
return;
}
alert(data.datas); alert(data.datas);
}
return; return;
} }
@@ -708,6 +706,8 @@ function set_agreement(event, el, sselcont_id, boolean_value)
agreement : boolean_value agreement : boolean_value
}, },
success: function(datas){ success: function(datas){
if(!datas.error)
{
if(boolean_value == '1') if(boolean_value == '1')
{ {
$('.agree_'+sselcont_id+'').removeClass('not_decided'); $('.agree_'+sselcont_id+'').removeClass('not_decided');
@@ -725,6 +725,11 @@ function set_agreement(event, el, sselcont_id, boolean_value)
{ {
if(confirm(datas.releasable)) if(confirm(datas.releasable))
$('#basket_options .confirm_report').trigger('click'); $('#basket_options .confirm_report').trigger('click');
}
}
else
{
alert(datas.datas);
} }
return; return;
} }

View File

@@ -217,12 +217,10 @@ function set_release(el)
$('.loader', el).css({ $('.loader', el).css({
visibility:'hidden' visibility:'hidden'
}); });
if(data.error) if(data.datas)
{ {
return;
}
alert(data.datas); alert(data.datas);
}
return; return;
} }
@@ -759,6 +757,8 @@ function set_agreement(event, el, sselcont_id, boolean_value)
agreement : boolean_value agreement : boolean_value
}, },
success: function(datas){ success: function(datas){
if(!datas.error)
{
if(boolean_value == '1') if(boolean_value == '1')
{ {
$('.agree_'+sselcont_id+'').removeClass('not_decided'); $('.agree_'+sselcont_id+'').removeClass('not_decided');
@@ -777,6 +777,11 @@ function set_agreement(event, el, sselcont_id, boolean_value)
if(confirm(datas.releasable)) if(confirm(datas.releasable))
$('#basket_options .confirm_report').trigger('click'); $('#basket_options .confirm_report').trigger('click');
} }
}
else
{
alert(datas.datas);
}
return; return;
} }
}); });

View File

@@ -24,6 +24,8 @@ $(document).ready(function(){
$.mobile.pageLoading(true); $.mobile.pageLoading(true);
}, },
success: function(datas){ success: function(datas){
if(!datas.error)
{
if(agreement == '1') if(agreement == '1')
$('.valid_choice_'+sselcont_id).removeClass('disagree').addClass('agree'); $('.valid_choice_'+sselcont_id).removeClass('disagree').addClass('agree');
else else
@@ -34,6 +36,11 @@ $(document).ready(function(){
alert(datas.datas); alert(datas.datas);
return; return;
} }
}
else
{
alert(datas.datas);
}
return; return;
} }
}); });