forked from tykayn/funky-framadate-front
Ajout d'un champ texte en cas de sondage classique
avancement sur le #20
This commit is contained in:
parent
cdbe0a12e1
commit
45319fcfd6
@ -29,14 +29,12 @@
|
|||||||
</select>
|
</select>
|
||||||
</p>
|
</p>
|
||||||
<ul id="responses">
|
<ul id="responses">
|
||||||
<li>
|
|
||||||
<a href="responses.html" id="add-response-choice" class="btn next">Ajouter</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<nav>
|
<nav>
|
||||||
|
<a href="responses.html" id="add-response-choice" class="btn next">Ajouter</a>
|
||||||
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
<a href="recapitulatif.html" class="btn next">Continuer</a>
|
||||||
<a href="responses.html" class="btn next">Tout effacer</a>
|
<a href="responses.html" class="btn next">Tout effacer</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -52,6 +52,16 @@ const createModal = (text) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const buildTextField = () => {
|
||||||
|
var field = document.createElement("input")
|
||||||
|
var deleteButton = document.createElement("button")
|
||||||
|
var fieldBloc = document.createElement("span")
|
||||||
|
fieldBloc.appendChild(field);
|
||||||
|
fieldBloc.appendChild(deleteButton);
|
||||||
|
return fieldBloc
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$$('input').forEach((inputElement) => {
|
$$('input').forEach((inputElement) => {
|
||||||
inputElement.addEventListener("change", () => {
|
inputElement.addEventListener("change", () => {
|
||||||
localStorage[inputElement.name] = inputElement.value
|
localStorage[inputElement.name] = inputElement.value
|
||||||
@ -62,13 +72,13 @@ if($("#add-response-choice")) {
|
|||||||
$("#add-response-choice").addEventListener('click', (e) => {
|
$("#add-response-choice").addEventListener('click', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let response = document.createElement("li");
|
let response = document.createElement("li");
|
||||||
let text = document.createTextNode("Blabla");
|
response.appendChild(buildTextField());
|
||||||
response.appendChild(text);
|
|
||||||
|
|
||||||
$("#responses").appendChild(response);
|
$("#responses").appendChild(response);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$$(".next").forEach((button) => {
|
$$(".next").forEach((button) => {
|
||||||
button.addEventListener("click", (e) => {
|
button.addEventListener("click", (e) => {
|
||||||
$$(".toggle-field").forEach((field) => {
|
$$(".toggle-field").forEach((field) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user