Commit 1a686425 authored by Julien Ait azzouzene's avatar Julien Ait azzouzene
Browse files

feat: changements dans l'interface en vue de la

V2
parent 2da99337
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -11,10 +11,19 @@
    <input type="search" id="codePostalInput" placeholder="Entrez votre code postal" aria-label="code postal"><button id="recherche" >Rechercher</button>
    <br>

    <select id="villeListe" class="cache" aria-label="ville">
    <div id="choixVille" class="cache">
        <select id="villeListe" aria-label="ville">
        <option>--Sélectionner une ville--</option>
        </select>

        <label>Nombre de jours :</label>
        <input id="inputNbJours" type="number" value="1" min="1" max="7"></input>

        <button id="voirInformations">Voir les informations</button>
    </div>
    
    

    <label>Nombre de jours :</label>
    <input id="inputNbJours" type="number" value="1" min="1" max="7"></input>

+6 −2
Original line number Diff line number Diff line
@@ -3,7 +3,11 @@
// Interface
const barreRechercheCodePostal = document.getElementById("codePostalInput");
const boutonRechercheCodePostal = document.getElementById("recherche");

const conteneurChoixVille = document.getElementById("choixVille");
const listeDeroulanteVilles = document.getElementById("villeListe");
const inputNombreJours = document.getElementById("inputNbJours");
const boutonVoirInformations = document.getElementById("voirInformations");

boutonRechercheCodePostal.addEventListener("click", onRechercher);
listeDeroulanteVilles.addEventListener("change", onSelectionneVille);
@@ -39,7 +43,7 @@ function onRechercher(){

function onErreurSaisieCodePostal(message){
    alert(message);
    listeDeroulanteVilles.classList.add("cache");
    conteneurChoixVille.classList.add("cache");
    zoneResultats.classList.add("cache");
}

@@ -49,7 +53,7 @@ function listeVille(){
    villes_insee.forEach((ville, codeInsee) => {
        listeDeroulanteVilles.innerHTML += `\n<option value="${codeInsee}">${ville}</option>`
    });
    listeDeroulanteVilles.classList.remove("cache");
    conteneurChoixVille.classList.remove("cache");
}

const setVilles = async codepostal => {