Skip to content

Instantly share code, notes, and snippets.

@andymckay
Created December 7, 2011 19:28
Show Gist options
  • Save andymckay/1444249 to your computer and use it in GitHub Desktop.
Save andymckay/1444249 to your computer and use it in GitHub Desktop.
diff --git a/media/js/zamboni/contributions.js b/media/js/zamboni/contributions.js
index 661e833..58d5534 100644
--- a/media/js/zamboni/contributions.js
+++ b/media/js/zamboni/contributions.js
@@ -34,10 +34,21 @@ var purchases = {
}
}
});
+ setTimeout(purchases.lookForThanks, 1000);
return false;
});
purchases.result();
},
+ lookForThanks: function() {
+ console.log('looking for thanks');
+ if ($('a.trigger_app_install').exists()) {
+ console.log('found thanks');
+ purchases.thanks(window);
+ } else {
+ console.log('waiting');
+ setTimeout(purchases.lookForThanks, 1000);
+ }
+ },
record: function($install, callback) {
/* Record the install of the app. This is badly named because it
* is not necessarily related to a purchase. */
@@ -68,9 +79,7 @@ var purchases = {
if (top_dgFlow !== null) {
var thanks_url = $('#paypal-thanks').attr('href');
if(thanks_url) {
- top_opener.modalFromURL(thanks_url, {'callback': function() {
- purchases.thanks(top_opener);
- }});
+ top_opener.modalFromURL(thanks_url);
}
top_dgFlow.closeFlow();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment