steps pass context buildNavItems

This commit is contained in:
elclanrs 2013-10-07 19:00:12 -04:00
parent e692072985
commit f86bdc9f59
5 changed files with 1314 additions and 2 deletions

View file

@ -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)

View file

@ -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',

View file

@ -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

File diff suppressed because one or more lines are too long