steps pass context buildNavItems
This commit is contained in:
parent
e692072985
commit
f86bdc9f59
5 changed files with 1314 additions and 2 deletions
11
README.md
11
README.md
|
@ -537,6 +537,17 @@ Steps adds the following options to Ideal Forms:
|
|||
}
|
||||
```
|
||||
|
||||
For example, you could build the steps with your own text like so:
|
||||
|
||||
```javascript
|
||||
steps: {
|
||||
MY_stepsItems: ['One', 'Two', 'Three'],
|
||||
buildNavItems: function(i) {
|
||||
return this.opts.steps.MY_stepsItems[i];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Steps provides these methods:
|
||||
|
||||
#### .idealforms('goToStep', index)
|
||||
|
|
|
@ -180,6 +180,13 @@
|
|||
|
||||
$('form').idealforms({
|
||||
|
||||
steps: {
|
||||
MY_stepsItems: ['One', 'Two', 'Three'],
|
||||
buildNavItems: function(i) {
|
||||
return this.opts.steps.MY_stepsItems[i];
|
||||
}
|
||||
},
|
||||
|
||||
rules: {
|
||||
'username': 'required username ajax',
|
||||
'email': 'required email',
|
||||
|
|
|
@ -65,7 +65,7 @@ module.exports = {
|
|||
|
||||
if (this.opts.steps.buildNavItems) {
|
||||
this.opts.steps.buildNavItems = function(i) {
|
||||
return buildNavItems(i) + counter;
|
||||
return buildNavItems.call(self, i) + counter;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
2
js/out/jquery.idealforms.min.js
vendored
2
js/out/jquery.idealforms.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue