Ejegg has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/365648 )

Change subject: Disable form while redirecting to PayPal
......................................................................

Disable form while redirecting to PayPal

Bug: T167923
Change-Id: I92bf95118eb2f97be5045596c7d3ea9bcba39250
---
M modules/js/ext.donationInterface.forms.js
M paypal_gateway/express_checkout/forms/js/paypal.js
2 files changed, 7 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/48/365648/1

diff --git a/modules/js/ext.donationInterface.forms.js 
b/modules/js/ext.donationInterface.forms.js
index dd0a103..5b72dd3 100644
--- a/modules/js/ext.donationInterface.forms.js
+++ b/modules/js/ext.donationInterface.forms.js
@@ -31,7 +31,7 @@
        /**
         * Call the generic donation API and handle errors or execute a callback
         *
-        * @param {function()} successCallback will be called with response's 
'result' property
+        * @param {function(result)} successCallback will be called with 
response's 'result' property
         */
        function callDonateApi( successCallback ) {
                di.forms.disable();
diff --git a/paypal_gateway/express_checkout/forms/js/paypal.js 
b/paypal_gateway/express_checkout/forms/js/paypal.js
index 9f41454..fe61fbe 100644
--- a/paypal_gateway/express_checkout/forms/js/paypal.js
+++ b/paypal_gateway/express_checkout/forms/js/paypal.js
@@ -3,6 +3,12 @@
 
        function redirect( result ) {
                top.location.href = result.formaction;
+               window.setTimeout( function() {
+                       // Needs to be in this setTimeout because callDonateApi 
has an
+                       // 'enable()' call in the AJAX 'complete' callback. We 
want donors
+                       // to see our loading spinner while redirecting to 
PayPal.
+                       di.forms.disable();
+               }, 50 );
        }
 
        di.forms.submit = function () {

-- 
To view, visit https://gerrit.wikimedia.org/r/365648
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92bf95118eb2f97be5045596c7d3ea9bcba39250
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <ej...@ejegg.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to