Update prices per person on key up

After user feedback
This commit is contained in:
Midgard 2022-04-22 01:25:01 +02:00
parent ced04acb2e
commit 5a9d9c1d31
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -119,12 +119,14 @@
$(".noscript").css("display", "none");
$(".script").css("display", "unset");
$("#per_dish input").on("change", e => {
function updatePerPersonPrices(e) {
console.log(e.target);
for (let item_id of e.target.dataset.forItems.split(",")) {
$("#item_" + item_id).val(e.target.value);
}
});
};
$("#per_dish input").on("change", updatePerPersonPrices);
$("#per_dish input").on("keyup", updatePerPersonPrices);
});
</script>
{% endblock %}