From 5a9d9c1d31cf149b6d3acc9d109c172103c644b6 Mon Sep 17 00:00:00 2001 From: Midgard Date: Fri, 22 Apr 2022 01:25:01 +0200 Subject: [PATCH] Update prices per person on key up After user feedback --- app/templates/order_prices.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/templates/order_prices.html b/app/templates/order_prices.html index bbb9ca5..d5eec77 100644 --- a/app/templates/order_prices.html +++ b/app/templates/order_prices.html @@ -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); }); {% endblock %}