From 278dfe44f53c02d3ce99ba209febb214d65d8b01 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Mon, 15 Oct 2018 05:57:08 +0200 Subject: [PATCH] Improve checkout UX (#6248) --- .../templates/includes/integrations/braintree_checkout.js | 8 ++++++++ .../templates/pages/integrations/braintree_checkout.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/frappe/templates/includes/integrations/braintree_checkout.js b/frappe/templates/includes/integrations/braintree_checkout.js index 96bc9c31bd..6e6ec4c206 100644 --- a/frappe/templates/includes/integrations/braintree_checkout.js +++ b/frappe/templates/includes/integrations/braintree_checkout.js @@ -42,6 +42,14 @@ $(document).ready(function() { }) }); }); + + instance.on('paymentMethodRequestable', function (event) { + button.removeAttribute('disabled'); + }); + + instance.on('noPaymentMethodRequestable', function () { + button.setAttribute('disabled', true); + }); }); }) diff --git a/frappe/templates/pages/integrations/braintree_checkout.html b/frappe/templates/pages/integrations/braintree_checkout.html index a9fec0ec50..bdc7b46ca5 100644 --- a/frappe/templates/pages/integrations/braintree_checkout.html +++ b/frappe/templates/pages/integrations/braintree_checkout.html @@ -26,7 +26,7 @@ - +