From e1ebc518bc651be2eacf15651fe5ed153984dc01 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 12 Jan 2024 16:44:36 +0000 Subject: [PATCH] =?utf8?q?donate:=20Fix=20donation=20form=20when=20donatin?= =?utf8?q?g=20more=20than=20$10/10=E2=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Tremer --- src/templates/donate/donate.html | 40 -------------------------------- 1 file changed, 40 deletions(-) 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 -- 2.47.3