From b7f08c07758cc77094d5b6791fd1688b02bcb44d Mon Sep 17 00:00:00 2001 From: Rich Christiansen Date: Thu, 28 Jun 2018 15:57:24 -0600 Subject: [PATCH] Fix https://github.com/thecodemine/formwizard/issues/19 --- js/jquery.form.wizard.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/jquery.form.wizard.js b/js/jquery.form.wizard.js index 854968c..f9ab551 100644 --- a/js/jquery.form.wizard.js +++ b/js/jquery.form.wizard.js @@ -90,6 +90,8 @@ this.backButtonInitinalValue = this.backButton.val(); this.backButton.val(this.options.textBack); + this.isAnimating = false; + if(this.options.validationEnabled && jQuery().validate == undefined){ this.options.validationEnabled = false; if( (window['console'] !== undefined) ){ @@ -145,6 +147,10 @@ }, _next : function(){ + if(this.isAnimating){ + return false; + } + if(this.options.validationEnabled){ if(!this.element.valid()){ this.element.validate().focusInvalid(); @@ -260,6 +266,7 @@ }, _animate : function(oldStep, newStep, stepShownCallback){ + this.isAnimating = true; this._disableNavigation(); var old = this.steps.filter("#" + oldStep); var current = this.steps.filter("#" + newStep); @@ -271,6 +278,7 @@ if(wizard.options.focusFirstInput) current.find(":input:first").focus(); wizard._enableNavigation(); + wizard.isAnimating = false; stepShownCallback.apply(wizard); });