Skip to content

Commit 3839dd7

Browse files
author
Nathaniel Blackburn
committed
Added addStep and addSteps functions
1 parent c57c061 commit 3839dd7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

intro.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,24 @@
16711671
_goToStep.call(this, step);
16721672
return this;
16731673
},
1674+
addStep: function(options) {
1675+
if (!this._options.hasOwnProperty('steps')) {
1676+
this._options.steps = [];
1677+
}
1678+
1679+
if (!this._options.steps.indexOf(options) === -1) {
1680+
this._options.steps.push(options);
1681+
}
1682+
1683+
return this;
1684+
},
1685+
addSteps: function(steps) {
1686+
if (!steps.hasOwnProperty('length')) return;
1687+
1688+
for(var index = 0; index < steps.length; index++) {
1689+
this.addStep(steps[index]);
1690+
}
1691+
},
16741692
nextStep: function() {
16751693
_nextStep.call(this);
16761694
return this;

0 commit comments

Comments
 (0)