Skip to content

Instantly share code, notes, and snippets.

@incrize
Created September 16, 2015 06:56
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/4ae5305573255151d9ed to your computer and use it in GitHub Desktop.
Save incrize/4ae5305573255151d9ed to your computer and use it in GitHub Desktop.
diff --git a/design/themes/basic/templates/views/checkout/components/checkout_steps.tpl b/design/themes/basic/templates/views/checkout/components/checkout_steps.tpl
index 0c98d83..cac4a35 100644
--- a/design/themes/basic/templates/views/checkout/components/checkout_steps.tpl
+++ b/design/themes/basic/templates/views/checkout/components/checkout_steps.tpl
@@ -24,6 +24,7 @@
{include file="views/checkout/components/steps/step_four.tpl" step="four" edit=$edit complete=$completed_steps.step_four}
<!--checkout_steps--></div>
{else}
+ <div id="checkout_steps">
{$smarty.capture.checkout_error_content nofilter}
{if $edit_step == "step_one"}
@@ -38,4 +39,22 @@
{elseif $edit_step == "step_four"}
{include file="views/checkout/components/steps/step_four.tpl" edit=true complete=$completed_steps.step_four}
{/if}
-{/if}
\ No newline at end of file
+ <!--checkout_steps--></div>
+{/if}
+<script type="text/javascript">
+(function(_, $) {
+ $.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.$));
+</script>
\ No newline at end of file
diff --git a/js/tygh/core.js b/js/tygh/core.js
index f133039..d4135d4 100644
--- a/js/tygh/core.js
+++ b/js/tygh/core.js
@@ -1251,8 +1251,10 @@ var Tygh = {
if (toggle == 'show') {
loading_box.show();
+ $.ceEvent('trigger', 'ce.loadershow', [loading_box]);
} else {
loading_box.hide();
+ $.ceEvent('trigger', 'ce.loaderhide', [loading_box]);
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment