From: Radek Czajka Date: Wed, 3 Dec 2025 13:40:40 +0000 (+0100) Subject: fixes #OG-196: clear buttons on custom amount X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/aba451da713f7acbed28f379aa92c8e116d262f3?ds=sidebyside fixes #OG-196: clear buttons on custom amount --- diff --git a/src/club/templates/club/donation_step1_form.html b/src/club/templates/club/donation_step1_form.html index 655febe07..e30fff8b2 100644 --- a/src/club/templates/club/donation_step1_form.html +++ b/src/club/templates/club/donation_step1_form.html @@ -21,7 +21,7 @@ {% with amounts=club.get_amounts %}
{% for amount in amounts.single %} -
+
{% if amount.description %} @@ -40,7 +40,7 @@
{% for amount in amounts.monthly %} -
+
{% if amount.description %}

{{ amount.description|safe }}

diff --git a/src/wolnelektury/static/js/main.js b/src/wolnelektury/static/js/main.js index a27d97171..076277e98 100644 --- a/src/wolnelektury/static/js/main.js +++ b/src/wolnelektury/static/js/main.js @@ -341,6 +341,14 @@ $('#id_custom_amount').val(''); }); + $('#id_custom_amount').on('input', function() { + if ($(this).val() > 0) { + $('.l-checkout__payments__box.is-active').removeClass('is-active'); + } else { + $('.l-checkout__payments__box.initial-active').addClass('is-active'); + } + }); + $('.donation-mod-monthly').on('click', function() { $.ajax({ method: 'POST',