Sandwitch and CSS fix
This commit is contained in:
parent
988f04f179
commit
97324b7342
3 changed files with 16 additions and 5 deletions
|
@ -521,6 +521,13 @@ textarea.input2 + .focus-input2::after {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.liste .WIP {
|
||||||
|
background-color: rgb(70, 170, 185);
|
||||||
|
}
|
||||||
|
|
||||||
|
.liste .finis {
|
||||||
|
background-color: rgb(185, 176, 30);
|
||||||
|
}
|
||||||
|
|
||||||
.liste .donnee {
|
.liste .donnee {
|
||||||
background-color: rgb(0, 105, 0);
|
background-color: rgb(0, 105, 0);
|
||||||
|
|
|
@ -5,7 +5,9 @@ let done = document.getElementById("realisee");
|
||||||
let waiting = document.getElementById("attente");
|
let waiting = document.getElementById("attente");
|
||||||
|
|
||||||
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
|
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
|
||||||
done.insertAdjacentHTML("beforeend", `<div id=cmd${id}> <h1>${id}</h1><h2></h2><p>${plate} | ${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p> </div>`);
|
if (!sandwitch)
|
||||||
|
sandwitch = "";
|
||||||
|
done.insertAdjacentHTML("beforeend", `<div id=cmd${id}> <h1>${id}</h1><h2>${sandwitch}</h2><p>${plate} | ${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p> </div>`);
|
||||||
let e = document.getElementById(`cmd${id}`);
|
let e = document.getElementById(`cmd${id}`);
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case "WIP":
|
case "WIP":
|
||||||
|
@ -71,7 +73,7 @@ socket.on("list command", data => {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("list service", data => {
|
socket.on("list service", data => {
|
||||||
service = data["list"]
|
service = data["list"];
|
||||||
if (service.length === 0)
|
if (service.length === 0)
|
||||||
alert("No service set !");
|
alert("No service set !");
|
||||||
else
|
else
|
||||||
|
@ -79,7 +81,7 @@ socket.on("list service", data => {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("new command", data => {
|
socket.on("new command", data => {
|
||||||
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state);
|
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state, data.sandwitch);
|
||||||
waiter();
|
waiter();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,9 @@ let radios = {"plate": null, "drink": null, "dessert": null};
|
||||||
|
|
||||||
|
|
||||||
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
|
function addcmd(id, plate, ingredient, sauce, drink, dessert, state, sandwitch) {
|
||||||
list.insertAdjacentHTML("beforeend", `<div class="com" id="cmd${id}"> <button class="donner">Donnée</button> <h1>${id}</h1> <div class="spec"> <h2></h2><p>${plate}</p><p>${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p><button class="annuler">Annuler</button><button class="erreur">Erreur</button> </div> </div>`);
|
if (!sandwitch)
|
||||||
|
sandwitch = "";
|
||||||
|
list.insertAdjacentHTML("beforeend", `<div class="com" id="cmd${id}"> <button class="donner">Donnée</button> <h1>${id}</h1> <div class="spec"> <h2>${sandwitch}</h2><p>${plate}</p><p>${ingredient}</p><p>${sauce}</p><p>${drink}</p><p>${dessert}</p><button class="annuler">Annuler</button><button class="erreur">Erreur</button> </div> </div>`);
|
||||||
let e = document.querySelector(`.liste #cmd${id}`);
|
let e = document.querySelector(`.liste #cmd${id}`);
|
||||||
e.addEventListener( "click" ,ev => {
|
e.addEventListener( "click" ,ev => {
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
@ -230,7 +232,7 @@ socket.on("list dessert", data => {
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("new command", data => {
|
socket.on("new command", data => {
|
||||||
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state);
|
addcmd(data.id, data.plate, data.ingredient, data.sauce, data.drink, data.dessert, data.state, data.sandwitch);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("cleared command", data => {
|
socket.on("cleared command", data => {
|
||||||
|
|
Reference in a new issue