]> git.ipfire.org Git - ipfire.org.git/commitdiff
donate: Fix donation form when donating more than $10/10€
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Jan 2024 16:44:36 +0000 (16:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 12 Jan 2024 16:44:36 +0000 (16:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/donate/donate.html

index a3d1f3baf968ef89c282f28cd36ae457132d4875..519d88eb1cd7ae4c3bb4a283b07d7ad79e284890 100644 (file)
                        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
 
                                        // 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