MDL-69166 pg_paypal: only prevent closing during autorisation
authorShamim Rezaie <shamim@moodle.com>
Tue, 29 Sep 2020 11:33:16 +0000 (21:33 +1000)
committerShamim Rezaie <shamim@moodle.com>
Tue, 27 Oct 2020 04:44:59 +0000 (15:44 +1100)
payment/gateway/paypal/amd/build/gateways_modal.min.js
payment/gateway/paypal/amd/build/gateways_modal.min.js.map
payment/gateway/paypal/amd/src/gateways_modal.js

index fa4872a..947d636 100644 (file)
Binary files a/payment/gateway/paypal/amd/build/gateways_modal.min.js and b/payment/gateway/paypal/amd/build/gateways_modal.min.js differ
index 503b693..76f9cb4 100644 (file)
Binary files a/payment/gateway/paypal/amd/build/gateways_modal.min.js.map and b/payment/gateway/paypal/amd/build/gateways_modal.min.js.map differ
index 45fbfb1..adea363 100644 (file)
@@ -63,11 +63,6 @@ export const process = async(amount, currency, component, componentid, descripti
         Repository.getConfigForJs(),
     ]);
 
-    modal.getRoot().on(ModalEvents.outsideClick, (e) => {
-        // Prevent closing the modal when clicking outside of it.
-        e.preventDefault();
-    });
-
     modal.getRoot().on(ModalEvents.hidden, () => {
         // Destroy when hidden.
         modal.destroy();
@@ -97,6 +92,11 @@ export const process = async(amount, currency, component, componentid, descripti
             },
             // Finalise the transaction.
             onApprove: function(data) {
+                modal.getRoot().on(ModalEvents.outsideClick, (e) => {
+                    // Prevent closing the modal when clicking outside of it.
+                    e.preventDefault();
+                });
+
                 modal.setBody(getString('authorising', 'pg_paypal'));
 
                 // Call server to validate and capture payment for order.