mstratman / jQuery-Smart-Wizard

flexible jQuery plug-in that gives wizard like interface

Home Page:http://mstratman.github.com/jQuery-Smart-Wizard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

finish button not disabled when click on previous button in last step to previous one

LakshmanKatragadda opened this issue · comments

ex: i have 4 steps .i clicked previous button in 4 step .it came to 3 step but finish button not disabled

1
2
3
4

capture

I have the same problem!

I had the same problem when i had noForwardJumping property enabled. I resolved it moving method _adjustButton($this) from the line 279 to after line 292 into file query.smartWizard.js.

I think the problem was that method enableFinish check this

"!this.steps.hasClass('disabled')" but _adjustButton($this) method is called before disable
needed steps

So te correct way is call _adjustButton($this) at the end of _setupStep function :

if($.isFunction($this.options.onShowStep)) {
var context = { fromStep: parseInt($(curStep).attr('rel')), toStep: parseInt($(selStep).attr('rel')) };
if(! $this.options.onShowStep.call(this,$(selStep),context)){
return false;
}
}
if ($this.options.noForwardJumping) {
// +2 == +1 (for index to step num) +1 (for next step)
for (var i = $this.curStepIdx + 2; i <= $this.steps.length; i++) {
$this.disableStep(i);
}
}
_adjustButton($this);