MCPcopy
hub / github.com/shipshapecode/shepherd / addStep

Method addStep

shepherd.js/src/tour.ts:165–181  ·  view source on GitHub ↗

* Adds a new step to the tour * @param {StepOptions} options - An object containing step options or a Step instance * @param {number | undefined} index - The optional index to insert the step at. If undefined, the step * is added to the end of the array. * @return The newly added step

(options: StepOptions | Step, index?: number)

Source from the content-addressed store, hash-verified

163 * @return The newly added step
164 */
165 addStep(options: StepOptions | Step, index?: number) {
166 let step = options;
167
168 if (!(step instanceof Step)) {
169 step = new Step(this, step);
170 } else {
171 step.tour = this;
172 }
173
174 if (!isUndefined(index)) {
175 this.steps.splice(index, 0, step as Step);
176 } else {
177 this.steps.push(step as Step);
178 }
179
180 return step;
181 }
182
183 /**
184 * Add multiple steps to the tour

Callers 4

addStepsMethod · 0.95
step.spec.jsFile · 0.80
tour.spec.jsFile · 0.80
a11y.cy.jsFile · 0.80

Calls 1

isUndefinedFunction · 0.90

Tested by

no test coverage detected