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

Method show

shepherd.js/src/tour.ts:323–345  ·  view source on GitHub ↗

* Show a specific step in the tour * @param {number | string} key - The key to look up the step by * @param {boolean} forward - True if we are going forward, false if backward

(key: number | string = 0, forward = true)

Source from the content-addressed store, hash-verified

321 * @param {boolean} forward - True if we are going forward, false if backward
322 */
323 show(key: number | string = 0, forward = true) {
324 const step = isString(key) ? this.getById(key) : this.steps[key];
325
326 if (step) {
327 this._updateStateBeforeShow();
328
329 const shouldSkipStep =
330 isFunction(step.options.showOn) && !step.options.showOn();
331
332 // If `showOn` returns false, we want to skip the step, otherwise, show the step like normal
333 if (shouldSkipStep) {
334 this._skipStep(step, forward);
335 } else {
336 this.currentStep = step;
337 this.trigger('show', {
338 step,
339 previous: this.currentStep
340 });
341
342 step.show();
343 }
344 }
345 }
346
347 /**
348 * Start the tour

Callers 7

backMethod · 0.95
nextMethod · 0.95
removeStepMethod · 0.95
_skipStepMethod · 0.95
step.spec.jsFile · 0.45
tour.spec.jsFile · 0.45

Calls 6

getByIdMethod · 0.95
_skipStepMethod · 0.95
isStringFunction · 0.90
isFunctionFunction · 0.90
triggerMethod · 0.80

Tested by

no test coverage detected