File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
11
11
( function ( $ ) {
12
- $ . fn . formToWizard = function ( options , cmdParam1 ) {
12
+ $ . fn . formToWizard = function ( options , cmdParam1 , cmdParam2 ) {
13
13
// Stop when selector found nothing!
14
14
if ( this . length == 0 ) return this ;
15
15
87
87
initCommands ( ) ;
88
88
89
89
if ( typeof commands [ cmd ] === 'function' ) {
90
- commands [ cmd ] ( cmdParam1 ) ;
90
+ commands [ cmd ] ( cmdParam1 , cmdParam2 ) ;
91
91
} else {
92
92
throw cmd + ' is invalid command!' ;
93
93
}
100
100
options = $ ( element ) . data ( 'options' ) ;
101
101
102
102
commands = {
103
- GotoStep : function ( stepNo ) {
103
+ GotoStep : function ( stepNo , currentStep ) {
104
104
var stepName = "step" + ( -- stepNo ) ;
105
105
106
106
if ( $ ( '#' + stepName ) [ 0 ] === undefined ) {
107
107
throw 'Step No ' + stepNo + ' not found!' ;
108
108
}
109
109
110
- if ( $ ( '#' + stepName ) . css ( 'display' ) === 'none' ) {
111
- $ ( element ) . find ( '.stepDetails' ) . hide ( ) ;
112
- $ ( '#' + stepName ) . show ( ) ;
113
- selectStep ( stepNo ) ;
110
+ if ( currentStep !== undefined || options . validateBeforeNext ( element , $ ( "#" + currentStep ) ) === true ) {
111
+
112
+ if ( $ ( '#' + stepName ) . css ( 'display' ) === 'none' ) {
113
+ $ ( element ) . find ( '.stepDetails' ) . hide ( ) ;
114
+ $ ( '#' + stepName ) . show ( ) ;
115
+ selectStep ( stepNo ) ;
116
+ }
114
117
}
115
118
} ,
116
119
NextStep : function ( ) {
You can’t perform that action at this time.
0 commit comments