From: Michael Tremer Date: Fri, 12 Jan 2024 16:44:36 +0000 (+0000) Subject: donate: Fix donation form when donating more than $10/10€ X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1ebc518bc651be2eacf15651fe5ed153984dc01;p=ipfire.org.git donate: Fix donation form when donating more than $10/10€ Signed-off-by: Michael Tremer --- diff --git a/src/templates/donate/donate.html b/src/templates/donate/donate.html index a3d1f3ba..519d88eb 100644 --- a/src/templates/donate/donate.html +++ b/src/templates/donate/donate.html @@ -474,7 +474,6 @@ var currency = $("input[name='currency']"); var frequency = $("input[name='frequency']"); var submit = $("#donate"); - var modal = $("#modal-monthly-suggestions"); var form = $("#donation-form"); // Adjust form to default currency @@ -574,51 +573,12 @@ // Update all amounts $(".amount").html(value); - - // Update suggestions - $(".monthly-amount-suggestion").each(function (i, element) { - var factor = $(element).data("factor"); - if (!factor) - return; - - var suggested_amount = Math.floor(value / factor); - - // Update value - $(element).data("amount", suggested_amount); - - // Update text on button - $(element).find(".suggested-amount").html(suggested_amount); - }); - } - }); - - submit.click(function (event) { - if (frequency.val() == "one-time" && amount.val() > 10) { - event.preventDefault(); - - modal.modal("show"); } }); // Disable all submit buttons after the form has been submitted form.one("submit", function() { submit.prop("disabled", true); - $(".monthly-amount-suggestion").prop("disabled", true); - }); - - $(".monthly-amount-suggestion").click(function (event) { - // Set frequency to monthly - $("input[name='frequency-selector']").prop("checked", false); - $("input[name='frequency-selector'][value='monthly']").prop("checked", true); - frequency.val("monthly"); - - // Set amount - var value = $(this).data("amount"); - amount.val(value); - amount.change(); - - // Hide the modal - modal.modal("hide"); }); // Update everything depending on type