Skip to content

Tour

Class representing the site tour

Extends

Constructors

new Tour(options)

new Tour(options): Tour

Parameters

options: TourOptions= {}

Returns

Tour

Overrides

Evented.constructor

Source

tour.ts:118

Properties

bindings

bindings: Bindings

Inherited from

Evented.bindings

Source

evented.ts:11


classPrefix

classPrefix: string

Source

tour.ts:109


currentStep?

optional currentStep: null | Step

Source

tour.ts:110


focusedElBeforeOpen?

optional focusedElBeforeOpen: null | HTMLElement

Source

tour.ts:111


id?

optional id: string

Source

tour.ts:112


optional modal: any

Source

tour.ts:114


options

options: TourOptions

Source

tour.ts:115


steps

steps: Step[]

Source

tour.ts:116


trackedEvents

trackedEvents: string[]

Source

tour.ts:107

Methods

_setupActiveTour()

_setupActiveTour(): void

Make this tour “active”

Returns

void

Source

tour.ts:407


addStep()

addStep(options, index?): Step | StepOptions

Adds a new step to the tour

Parameters

options: Step | StepOptions

An object containing step options or a Step instance

index?: number

The optional index to insert the step at. If undefined, the step is added to the end of the array.

Returns

Step | StepOptions

The newly added step

Source

tour.ts:164


addSteps()

addSteps(steps?): Tour

Add multiple steps to the tour

Parameters

steps?: StepOptions[] | Step[]

The steps to add to the tour

Returns

Tour

Source

tour.ts:186


back()

back(): void

Go to the previous step in the tour

Returns

void

Source

tour.ts:199


cancel()

cancel(): Promise<void>

Calls _done() triggering the ‘cancel’ event If confirmCancel is true, will show a window.confirm before cancelling If confirmCancel is a function, will call it and wait for the return value, and only cancel when the value returned is true

Returns

Promise<void>

Source

tour.ts:210


complete()

complete(): void

Calls _done() triggering the complete event

Returns

void

Source

tour.ts:234


getById()

getById(id): undefined | Step

Gets the step from a given id

Parameters

id: string | number

The id of the step to retrieve

Returns

undefined | Step

The step corresponding to the id

Source

tour.ts:243


getCurrentStep()

getCurrentStep(): undefined | null | Step

Gets the current step

Returns

undefined | null | Step

Source

tour.ts:252


hide()

hide(): void

Hide the current step

Returns

void

Source

tour.ts:259


isActive()

isActive(): boolean

Check if the tour is active

Returns

boolean

Source

tour.ts:270


next()

next(): void

Go to the next step in the tour If we are at the end, call complete

Returns

void

Source

tour.ts:278


off()

off(event, handler): Tour

Removes an event listener for the given event string.

Parameters

event: string

handler: AnyHandler

Returns

Tour

Inherited from

Evented.off

Source

evented.ts:53


on()

on(event, handler, ctx?, once?): Tour

Adds an event listener for the given event string.

Parameters

event: string

handler: AnyHandler

ctx?: unknown

once?: boolean= false

Returns

Tour

Inherited from

Evented.on

Source

evented.ts:22


once()

once(event, handler, ctx?): Tour

Adds an event listener that only fires once for the given event string.

Parameters

event: string

handler: AnyHandler

ctx?: unknown

Returns

Tour

Inherited from

Evented.once

Source

evented.ts:42


removeStep()

removeStep(name): void

Removes the step from the tour

Parameters

name: string

The id for the step to remove

Returns

void

Source

tour.ts:292


setupModal()

setupModal(): void

setupModal create the modal container and instance

Returns

void

Source

tour.ts:416


show()

show(key, forward): void

Show a specific step in the tour

Parameters

key: string | number= 0

The key to look up the step by

forward: boolean= true

True if we are going forward, false if backward

Returns

void

Source

tour.ts:322


start()

start(): Promise<void>

Start the tour

Returns

Promise<void>

Source

tour.ts:349


trigger()

trigger(event, …args): Tour

Triggers an event listener for the given event string.

Parameters

event: string

• …args: any[]

Returns

Tour

Inherited from

Evented.trigger

Source

evented.ts:78