More donation form fixes.
[wolnelektury.git] / src / wolnelektury / static / js / main.js
index a27d971..9821c77 100644 (file)
         $('#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',
            data: {
                csrfmiddlewaretoken: $("[name=csrfmiddlewaretoken]").val(),
+               monthly: $(this).data('monthly'),
            },
            url: $(this).data('url'),
            success: function(data) {