2017-03-30 17:00:35 +02:00
|
|
|
$(document).on('turbolinks:load', the_terms);
|
|
|
|
$(document).on('turbolinks:load', pannel_switch);
|
2016-12-27 15:26:41 +01:00
|
|
|
|
|
|
|
function pannel_switch() {
|
|
|
|
$('#switch-notifications').click(function () {
|
2017-04-12 11:12:05 +02:00
|
|
|
$('#procedure-list').addClass('hidden');
|
|
|
|
$('#notifications-list').removeClass('hidden');
|
2016-12-27 15:26:41 +01:00
|
|
|
$(this).addClass('active');
|
|
|
|
$('#switch-procedures').removeClass('active');
|
|
|
|
})
|
|
|
|
$('#switch-procedures').click(function () {
|
2017-04-12 11:12:05 +02:00
|
|
|
$('#notifications-list').addClass('hidden');
|
|
|
|
$('#procedure-list').removeClass('hidden');
|
2016-12-27 15:26:41 +01:00
|
|
|
$(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() {
|
2017-04-04 16:15:33 +02:00
|
|
|
var the_terms = $("#dossier_autorisation_donnees");
|
2016-06-20 13:57:57 +02:00
|
|
|
|
2017-04-04 16:15:33 +02:00
|
|
|
if (the_terms.size() == 0)
|
|
|
|
return;
|
2016-06-20 13:57:57 +02:00
|
|
|
|
2017-04-04 16:15:33 +02:00
|
|
|
check_value(the_terms);
|
2016-06-20 13:57:57 +02:00
|
|
|
|
2017-04-04 16:15:33 +02:00
|
|
|
the_terms.click(function () {
|
|
|
|
check_value(the_terms);
|
|
|
|
});
|
2016-06-20 13:57:57 +02:00
|
|
|
|
2017-04-04 16:15:33 +02:00
|
|
|
function check_value(the_terms) {
|
|
|
|
if (the_terms.is(":checked")) {
|
|
|
|
$("#etape_suivante").removeAttr("disabled");
|
|
|
|
} else {
|
|
|
|
$("#etape_suivante").attr("disabled", "disabled");
|
2016-06-20 13:57:57 +02:00
|
|
|
}
|
2017-04-04 16:15:33 +02:00
|
|
|
}
|
2016-06-20 13:57:57 +02:00
|
|
|
}
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function error_form_siret(invalid_siret) {
|
2017-04-04 16:15:33 +02:00
|
|
|
setTimeout(function () {
|
|
|
|
$("input[type='submit']").val('Erreur SIRET');
|
|
|
|
}, 10);
|
2016-09-16 17:08:50 +02:00
|
|
|
|
2017-04-04 16:15:33 +02:00
|
|
|
$("input[type='submit']").removeClass('btn-success').addClass('btn-danger');
|
2016-09-16 17:08:50 +02:00
|
|
|
|
2017-04-12 11:12:05 +02:00
|
|
|
$("#dossier-siret").addClass('input-error').val(invalid_siret).on('input', reset_form_siret);
|
2016-06-20 13:57:57 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-11-24 19:33:34 +01:00
|
|
|
function reset_form_siret() {
|
2017-04-04 16:15:33 +02:00
|
|
|
$("input[type='submit']").removeClass('btn-danger').addClass('btn-success').val('Valider');
|
2017-04-12 11:12:05 +02:00
|
|
|
$("#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() {
|
2017-04-12 11:12:05 +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
|
|
|
}
|