From 379527cd58dc694d5396a02dee7f8130fa8934ff Mon Sep 17 00:00:00 2001 From: Sli Date: Mon, 16 Dec 2024 00:58:23 +0100 Subject: [PATCH] Add a nice animation on successful refilling --- counter/static/bundled/counter/counter-click-index.ts | 5 +++++ counter/templates/counter/counter_click.jinja | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/counter/static/bundled/counter/counter-click-index.ts b/counter/static/bundled/counter/counter-click-index.ts index 01d7e8f9..044d14de 100644 --- a/counter/static/bundled/counter/counter-click-index.ts +++ b/counter/static/bundled/counter/counter-click-index.ts @@ -44,6 +44,11 @@ exportToHtml("loadCounter", (config: CounterConfig) => { ).data.amount; }, + async onRefillingSuccess() { + await this.updateBalance(); + document.getElementById("selling-accordion").click(); + }, + async handleCode(event: SubmitEvent) { const code = ( $(event.target).find("#code_field").val() as string diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja index bc5c4e58..f9821bf1 100644 --- a/counter/templates/counter/counter_click.jinja +++ b/counter/templates/counter/counter_click.jinja @@ -32,7 +32,7 @@
-
{% trans %}Selling{% endtrans %}
+
{% trans %}Selling{% endtrans %}
{% set counter_click_url = url('counter:click', counter_id=counter.id, user_id=customer.user_id) %} @@ -103,7 +103,7 @@ {% if refilling_fragment %}
{% trans %}Refilling{% endtrans %}
{{ refilling_fragment }}