Commit eff4f693 by Damien Moulard

linting

parent 61ffcad7
Pipeline #1252 passed with stage
in 1 minute 22 seconds
...@@ -1553,35 +1553,35 @@ function update_order_selection_screen() { ...@@ -1553,35 +1553,35 @@ function update_order_selection_screen() {
dbc.allDocs({ dbc.allDocs({
include_docs: true include_docs: true
}) })
.then(function (result) { .then(function (result) {
// Remove listener before recreating them // Remove listener before recreating them
$(".order_pill").off(); $(".order_pill").off();
let existing_orders_container = $("#existing_orders"); let existing_orders_container = $("#existing_orders");
existing_orders_container.empty(); existing_orders_container.empty();
$('#new_order_name').val(''); $('#new_order_name').val('');
if (result.rows.length === 0) { if (result.rows.length === 0) {
existing_orders_container.append(`<i>Aucune commande en cours...</i>`); existing_orders_container.append(`<i>Aucune commande en cours...</i>`);
} else { } else {
for (let row of result.rows) { for (let row of result.rows) {
let template = $("#templates #order_pill_template"); let template = $("#templates #order_pill_template");
template.find(".pill_order_name").text(row.id); template.find(".pill_order_name").text(row.id);
existing_orders_container.append(template.html()); existing_orders_container.append(template.html());
}
$(".order_pill").on("click", order_pill_on_click);
} }
$(".order_pill").on("click", order_pill_on_click);
}
resolve(); resolve();
}) })
.catch(function (err) { .catch(function (err) {
alert('Erreur lors de la synchronisation des commandes. Vous pouvez créer une nouvelle commande.'); alert('Erreur lors de la synchronisation des commandes. Vous pouvez créer une nouvelle commande.');
console.log(err); console.log(err);
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment