From ea0127afcf3f7e0f2e2a758e336620eb3161fb93 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 13 Feb 2016 16:04:16 +1100 Subject: [PATCH] Stripe indicator is late to the party Fixes #1737 The AJAX events may fire before document.ready has executed, leaving $.oc.stripeLoadIndicator as null and throwing an error --- modules/system/assets/js/framework.extras.js | 8 ++++---- modules/system/assets/ui/js/loader.stripe.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/system/assets/js/framework.extras.js b/modules/system/assets/js/framework.extras.js index b57f7db15..e78619e91 100644 --- a/modules/system/assets/js/framework.extras.js +++ b/modules/system/assets/js/framework.extras.js @@ -30,7 +30,9 @@ .append($('
').addClass('stripe-loaded')) this.stripe = this.indicator.find('.stripe') - $(document.body).append(this.indicator) + $(document).ready(function(){ + $(document.body).append(this.indicator) + }) } StripeLoadIndicator.prototype.show = function() { @@ -57,9 +59,7 @@ } } - $(document).ready(function(){ - $.oc.stripeLoadIndicator = new StripeLoadIndicator() - }) + $.oc.stripeLoadIndicator = new StripeLoadIndicator() // STRIPE LOAD INDICATOR DATA-API // ============== diff --git a/modules/system/assets/ui/js/loader.stripe.js b/modules/system/assets/ui/js/loader.stripe.js index f41a74a23..01e6a35ad 100644 --- a/modules/system/assets/ui/js/loader.stripe.js +++ b/modules/system/assets/ui/js/loader.stripe.js @@ -22,7 +22,9 @@ .append($('
').addClass('stripe-loaded')) this.stripe = this.indicator.find('.stripe') - $(document.body).append(this.indicator) + $(document).ready(function(){ + $(document.body).append(this.indicator) + }) } StripeLoadIndicator.prototype.show = function() { @@ -49,9 +51,7 @@ } } - $(document).ready(function(){ - $.oc.stripeLoadIndicator = new StripeLoadIndicator() - }) + $.oc.stripeLoadIndicator = new StripeLoadIndicator() // STRIPE LOAD INDICATOR DATA-API // ==============