Tour
Class representing the site tour
Extends
Constructors
new Tour()
new Tour(
options
):Tour
Parameters
• options: TourOptions
= {}
Returns
Overrides
Defined in
tour.ts:118
Properties
bindings
bindings:
Bindings
Inherited from
Defined in
evented.ts:11
classPrefix
classPrefix:
string
Defined in
tour.ts:109
currentStep?
optional
currentStep:null
|Step
Defined in
tour.ts:110
focusedElBeforeOpen?
optional
focusedElBeforeOpen:null
|HTMLElement
Defined in
tour.ts:111
id?
optional
id:string
Defined in
tour.ts:112
modal?
optional
modal:any
Defined in
tour.ts:114
options
options:
TourOptions
Defined in
tour.ts:115
steps
steps:
Step
[]
Defined in
tour.ts:116
trackedEvents
trackedEvents:
string
[]
Defined in
tour.ts:107
Methods
_setupActiveTour()
_setupActiveTour():
void
Make this tour “active”
Returns
void
Defined in
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
The newly added step
Defined in
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
Defined in
tour.ts:186
back()
back():
void
Go to the previous step in the tour
Returns
void
Defined in
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
>
Defined in
tour.ts:210
complete()
complete():
void
Calls _done() triggering the complete
event
Returns
void
Defined in
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
Defined in
tour.ts:243
getCurrentStep()
getCurrentStep():
undefined
|null
|Step
Gets the current step
Returns
undefined
| null
| Step
Defined in
tour.ts:252
hide()
hide():
void
Hide the current step
Returns
void
Defined in
tour.ts:259
isActive()
isActive():
boolean
Check if the tour is active
Returns
boolean
Defined in
tour.ts:270
next()
next():
void
Go to the next step in the tour
If we are at the end, call complete
Returns
void
Defined in
tour.ts:278
off()
off(
event
,handler
?):Tour
Removes an event listener for the given event string.
Parameters
• event: string
• handler?: AnyHandler
Returns
Inherited from
Defined in
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
Inherited from
Defined in
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
Inherited from
Defined in
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
Defined in
tour.ts:292
setupModal()
setupModal():
void
setupModal create the modal container and instance
Returns
void
Defined in
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
Defined in
tour.ts:322
start()
start():
Promise
<void
>
Start the tour
Returns
Promise
<void
>
Defined in
tour.ts:349
trigger()
trigger(
event
, …args
):Tour
Triggers an event listener for the given event string.
Parameters
• event: string
• …args: any
[]
Returns
Inherited from
Defined in
evented.ts:78