Skip to content

Commit abc1479

Browse files
committed
Fix bug
Fix a bug about the validNextStep: if return false, the wizard stop the logical flow, but not the associated carousel !
1 parent 8c739ef commit abc1479

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Bootstrap/bootstrap-wizard/bootstrap-wizard.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,13 @@ $("#wizard").wizard({
117117

118118
this.$base.on("click", "> a", function(event){
119119
event.preventDefault();
120-
$(this).data("slide") == "next" ? self.next() : self.prev();
120+
121+
var preventEventPropagation = $(this).data("slide") == "next" ? self.next() : self.prev();
122+
123+
if(preventEventPropagation){
124+
event.stopPropagation();
125+
event.stopImmediatePropagation();
126+
}
121127
});
122128
};
123129

@@ -126,6 +132,7 @@ $("#wizard").wizard({
126132
this.$base.carousel(index);
127133
this.idx = index;
128134
this.update();
135+
129136
$.isFunction(this.options.changeStep) && this.options.changeStep(this.idx);
130137
}
131138

@@ -159,8 +166,11 @@ $("#wizard").wizard({
159166
this.idx--;
160167
this.update();
161168
$.isFunction(this.options.changeStep) && this.options.changeStep(this.idx);
169+
170+
return false;
162171
}
163172

173+
return true;
164174
};
165175

166176
Wizard.prototype.next = function() {
@@ -169,7 +179,11 @@ $("#wizard").wizard({
169179
this.idx++;
170180
this.update();
171181
$.isFunction(this.options.changeStep) && this.options.changeStep(this.idx);
182+
183+
return false;
172184
}
185+
186+
return true;
173187
};
174188

175189
Wizard.prototype.option = function(options){

0 commit comments

Comments
 (0)