From 945428b0c9ba97665d9a622628c40bb90ec74f21 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Mon, 7 Aug 2017 20:17:43 +0000 Subject: [PATCH] amount.one didn't hack it, back to amount.on. --- js/transaction.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/transaction.js b/js/transaction.js index d62439a..e8d8970 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -807,7 +807,7 @@ $(function() { $("#redeemable_hours").val(0); }); - + // membership transaction? var membership_transaction = false, membership_transaction_obj; $.post("json/transaction.php", { transaction_benefits: 1 }, function (data) { @@ -840,7 +840,7 @@ $(function() { var exp = obj.expiration_date; expiration_date = new Date(exp.split("-").toString()); if (d >= expiration_date) { - amount.one("input", function () { + amount.on("input", function () { $("#membership_discount").empty(); }); if ($("#expired_membership").length === 1) { @@ -858,7 +858,7 @@ $(function() { amount.on("input", function () { var discount = (price * (obj.membership_discount / 100).toFixed(2)).toFixed(2); var discount_price = (price - discount).toFixed(2); - console.log("original " + price + " discount " + discount + " discounted " + discount_price); + //console.log("original " + price + " discount " + discount + " discounted " + discount_price); $("#membership_discount").text("Member pays $" + discount_price).show(); }); @@ -867,13 +867,13 @@ $(function() { amount.on("input", function () { var discount = (price * (obj.membership_discount / 100).toFixed(2)).toFixed(2); var discount_price = (price - discount).toFixed(2); - console.log("original " + price + " discount " + discount + " discounted " + discount_price); + //console.log("original " + price + " discount " + discount + " discounted " + discount_price); $("#membership_discount").text("Member pays $" + discount_price).show(); }); } } } else { - amount.one("input", function () { + amount.on("input", function () { $("#membership_discount").empty(); }); if ($("#paid_member").length === 1) { @@ -909,7 +909,7 @@ $(function() { } else { price = amount.cleanVal(); } - console.log("original " + price); + //console.log("original " + price); $("#original_price").text(price); // How many hours does this volunteer have? @@ -986,9 +986,9 @@ $(function() { } else { // in some cases this is 1 if value is greater than price like 16 * 8 = 128 > 120 spinner_value = $(this).spinner("value"); - console.log("weird " + spinner_value); + //console.log("weird " + spinner_value); } - console.log("spinner value " + spinner_value); + //console.log("spinner value " + spinner_value); // function redeemable(obj, spinner_value) if (max > 0 || max === undefined) {