From b1a7f1dd8e38089162be74bd45c3d62a61f985c6 Mon Sep 17 00:00:00 2001 From: Nathan Peraldi Date: Thu, 4 Jul 2019 11:24:44 +0200 Subject: [PATCH] edit: formatted JS code --- adhesionForm.js | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/adhesionForm.js b/adhesionForm.js index df9f4f0..0a087d4 100644 --- a/adhesionForm.js +++ b/adhesionForm.js @@ -12,8 +12,6 @@ function displayMask(display) { } else { document.getElementById(blocks[h]).style.display = "none"; } - - } } @@ -36,26 +34,19 @@ function displayMaskOptions(display) { } toutesLesOptions[j].hidden = false; - - } else { console.log(display + "=/=" + toutesLesOptions[j].getAttribute("class")); toutesLesOptions[j].hidden = true; } } - } function firstAction() { //fonction effectuée lorsque le premier select est validé //on recup ce qui a été cliqué - - var e = document.getElementById("firstSelect"); var strUser = e.options[e.selectedIndex].value; - - //on reagit en fonction //si il a cliqué sur individu, redirigé vers helloasso @@ -68,8 +59,6 @@ function firstAction() { else if (strUser === "Association") { setCotisation("Association"); - - displayMask(["cotisation", "informationsCollectivite", "boutonEnvoyer"]); document.getElementById("secondSelection").required = false; setEPCIRequired(false); @@ -86,13 +75,11 @@ function firstAction() { //si il a cliqué sur autre chose : on cherche à connaitre la taille de la collectivité, on affiche le 2e select else { - displayMaskOptions(strUser); document.getElementById("secondSelection").required = true; displayMask(["paraSecondSelection"]); setEPCIRequired(false); - } } @@ -103,7 +90,6 @@ function isWordIn(word, list) { return true } } - return false } @@ -134,7 +120,6 @@ function prepareDocument() { break; } } - firstAction(); if (choiceType === "EPCIMutualisant") { @@ -158,8 +143,6 @@ function prepareDocument() { } } - - } var choicePeriod = document.getElementById("ancienSelectPeriod").getAttribute("value"); @@ -171,8 +154,6 @@ function prepareDocument() { listOfPeriodOptions[c].selected = true; } } - - } function secondAction() { @@ -189,14 +170,12 @@ function secondAction() { } else { displayMask(["paraSecondSelection"]); } - } function setCotisation(id, x = 0) { - //définit la cotisation à afficher, l'option x sert uniquement pour le tarif EPCI mutualisant qui varie. - + //définit la cotisation à afficher, l'option x sert uniquement pour le tarif EPCI mutualisant qui varie. var paragraphCotList = document.getElementsByClassName("PCOT"); var research = "PCOT-" + id; @@ -215,7 +194,6 @@ function setCotisation(id, x = 0) { console.log(paragraphCotList[b].getAttribute("id") + "=/=" + research); } } - } function setEPCIRequired(boolean) { @@ -249,7 +227,6 @@ function traitementEPCIMutualisant() { setCotisation("EPCIMutualisant", resultat); displayMask(["cotisation", "informationsCollectivite", "formulaireEPCIMutualisant", "boutonEnvoyer"]); - } } } -- GitLab