Skip to content

Instantly share code, notes, and snippets.

@incrize
Created September 17, 2015 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incrize/a5d5def291d8620c917b to your computer and use it in GitHub Desktop.
Save incrize/a5d5def291d8620c917b to your computer and use it in GitHub Desktop.
diff --git a/js/tygh/checkout.js b/js/tygh/checkout.js
index 8a72ef1..807aef7 100644
--- a/js/tygh/checkout.js
+++ b/js/tygh/checkout.js
@@ -128,6 +128,20 @@
});
});
+ $.ceEvent('on', 'ce.loadershow', function() {
+ var forms = $('#checkout_steps', _.doc).find('form');
+
+ forms.on('submit.checkout_lock', function() { return false; });
+ forms.find('button[type="submit"]').on('click.checkout_lock', function() { return false; });
+ });
+
+ $.ceEvent('on', 'ce.loaderhide', function() {
+ var forms = $('#checkout_steps', _.doc).find('form');
+
+ forms.off('submit.checkout_lock');
+ forms.find('button[type="submit"]').off('click.checkout_lock');
+ });
+
})(Tygh, Tygh.$);
function fn_switch_checkout_type()
diff --git a/js/tygh/core.js b/js/tygh/core.js
index da84624..e012393 100644
--- a/js/tygh/core.js
+++ b/js/tygh/core.js
@@ -1425,6 +1425,7 @@ var Tygh = {
loading_box.prop('class', loading_box.data('default_class')); // remove custom classes
$('#ajax_overlay').hide();
$('.cm-overlay').removeClass('cm-overlay').css('opacity', '1');
+ $.ceEvent('trigger', 'ce.loaderhide', [loading_box]);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment