2016-06-20 13:57:57 +02:00
|
|
|
$(document).on('page:load', the_terms);
|
|
|
|
$(document).ready(the_terms);
|
2016-12-27 15:26:41 +01:00
|
|
|
$(document).on('page:load', pannel_switch);
|
|
|
|
$(document).ready(pannel_switch);
|
|
|
|
|
|
|
|
function pannel_switch() {
|
|
|
|
$('#switch-notifications').click(function () {
|
|
|
|
$('#procedure_list').addClass('hidden');
|
|
|
|
$('#notifications_list').removeClass('hidden');
|
|
|
|
$(this).addClass('active');
|
|
|
|
$('#switch-procedures').removeClass('active');
|
|
|
|
})
|
|
|
|
$('#switch-procedures').click(function () {
|
|
|
|
$('#notifications_list').addClass('hidden');
|
|
|
|
$('#procedure_list').removeClass('hidden');
|
|
|
|
$(this).addClass('active');
|
|
|
|
$('#switch-notifications').removeClass('active');
|
|
|
|
})
|
|
|
|
}
|
2016-11-23 16:17:29 +01:00
|
|
|
|
2016-06-20 13:57:57 +02:00
|
|
|
function the_terms() {
|
|
|
|
var the_terms = $("#dossier_autorisation_donnees");
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
if (the_terms.size() == 0)
|
2016-06-20 13:57:57 +02:00
|
|
|
return;
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
check_value(the_terms);
|
2016-06-20 13:57:57 +02:00
|
|
|
|
|
|
|
the_terms.click(function () {
|
2016-11-24 19:33:34 +01:00
|
|
|
check_value(the_terms);
|
2016-06-20 13:57:57 +02:00
|
|
|
});
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function check_value(the_terms) {
|
2016-06-20 13:57:57 +02:00
|
|
|
if (the_terms.is(":checked")) {
|
|
|
|
$("#etape_suivante").removeAttr("disabled");
|
|
|
|
} else {
|
|
|
|
$("#etape_suivante").attr("disabled", "disabled");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function error_form_siret(invalid_siret) {
|
|
|
|
setTimeout(function () {
|
2016-09-16 17:08:50 +02:00
|
|
|
$("input[type='submit']").val('Erreur SIRET');
|
|
|
|
}, 10);
|
|
|
|
|
|
|
|
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
|
|
|
|
|
2016-06-20 13:57:57 +02:00
|
|
|
$("#dossier_siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function reset_form_siret() {
|
2016-06-20 13:57:57 +02:00
|
|
|
$("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider');
|
|
|
|
$("#dossier_siret").removeClass('input-error');
|
2016-07-18 09:37:22 +02:00
|
|
|
}
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function toggle_etape_1() {
|
2016-07-18 09:37:22 +02:00
|
|
|
$('.row.etape.etape_1 .etapes_menu #logos').toggle(100);
|
|
|
|
$('.row.etape.etape_1 .etapes_informations #description_procedure').toggle(100);
|
2016-11-23 16:17:29 +01:00
|
|
|
}
|