You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -125,22 +126,22 @@ const myTour = new Shepherd.Tour(options);
125
126
-`modalContainer` An optional container element for the modal. If not set, the modal will be appended to `document.body`.
126
127
-`steps`: An array of step options objects or Step instances to initialize the tour with.
127
128
-`tourName`: An optional "name" for the tour. This will be appended to the the tour's
128
-
dynamically generated `id` property.
129
+
dynamically generated `id` property.
129
130
-`useModalOverlay`: Whether or not steps should be placed above a darkened modal overlay. If true, the overlay will create an opening around the target element so that it can remain interactive.
130
131
131
132
##### Tour Methods
132
133
133
134
-`addStep(options)`: Creates a new Step object with options, and returns the `Step` instance it created. If the options hash doesn't include an `id`, one will be generated.
134
-
You can also pass an existing `Step` instance rather than `options`, but note that Shepherd does not support a Step being attached to multiple Tours.
135
+
You can also pass an existing `Step` instance rather than `options`, but note that Shepherd does not support a Step being attached to multiple Tours.
135
136
-`addSteps([Steps])`: Add multiple steps to the tour
136
137
-`getById(id)`: Return a step with a specific id
137
138
-`isActive()`: Check if the tour is active
138
139
-`next()`: Advance to the next step, in the order they were added
139
140
-`back()`: Show the previous step, in the order they were added
140
141
-`cancel()`: Trigger cancel on the current step, hiding it without advancing
141
-
-`complete()`: Calls _done() triggering the `complete` event
142
+
-`complete()`: Calls \_done() triggering the `complete` event
142
143
-`hide()`: Hide the current step
143
-
-`show([id])`: Show the step specified by id (if it's a string), or index (if it's a number) provided. Defaults to the first step.
144
+
-`show([id])`: Show the step specified by id (if it's a string), or index (if it's a number) provided. Defaults to the first step.
144
145
-`start()`: Show the first step and begin the tour
145
146
-`getCurrentStep()`: Returns the currently shown step
146
147
-`removeStep(id)`: Removes the step from the tour
@@ -169,7 +170,7 @@ created.
169
170
-`Function` to be executed when the step is built. It must return one the two options above.
170
171
-`title`: The step's title. It becomes an `h3` at the top of the step.
171
172
-`attachTo`: The element the step should be attached to on the page. An object with properties `element` and `on`.
172
-
-`element`: An element selector string, a DOM element, or a function (returning a selector, a DOM element, `null` or `undefined`).
173
+
-`element`: An element selector string, a DOM element, or a function (returning a selector, a DOM element, `null` or `undefined`).
173
174
-`on`: The optional direction to place the Floating UI tooltip relative to the element.
If you don’t specify an `attachTo` the element will appear in the middle of the screen. The same will happen if your
184
+
If you don’t specify an `attachTo` the element will appear in the middle of the screen. The same will happen if your
184
185
`attachTo.element` callback returns `null`, `undefined`, or a selector that does not exist in the DOM.
185
186
186
187
If you omit the `on` portion of `attachTo`, the element will still be highlighted, but the tooltip will appear
187
188
in the middle of the screen, without an arrow pointing to the target.
188
189
189
190
If the element to highlight does not yet exist while instantiating tour steps, you may use lazy evaluation by supplying a function to `attachTo.element`. The function will be called in the `before-show` phase.
191
+
190
192
-`beforeShowPromise`: A function that returns a promise. When the promise resolves, the rest of the `show` code for
191
-
the step will execute. For example:
193
+
the step will execute. For example:
192
194
```javascript
193
195
beforeShowPromise:function() {
194
196
returnnewPromise(function(resolve) {
@@ -210,16 +212,16 @@ the step will execute. For example:
210
212
-`secondary`: A boolean, that when true, adds a `shepherd-button-secondary` class to the button
211
213
-`text`: The HTML text of the button. It can also be a function that returns a string (useful with i18n solutions).
212
214
-`action`: A function executed when the button is clicked on.
213
-
It is automatically bound to the `tour` the step is associated with, so things like `this.next` will
214
-
work inside the action. You can use action to skip steps or navigate to specific steps, with something like:
215
-
```javascript
216
-
action() {
217
-
returnthis.show('some_step_name');
218
-
}
219
-
```
220
-
-`advanceOn`: An action on the page which should advance shepherd to the next step. It should be an object with a string `selector` and an `event` name.
221
-
For example: `{selector: '.some-element', event: 'click'}`. It doesn't have to be an event inside the tour, it can be any event fired on any element on the page.
222
-
You can also always manually advance the Tour by calling `myTour.next()`.
215
+
It is automatically bound to the `tour` the step is associated with, so things like `this.next` will
216
+
work inside the action. You can use action to skip steps or navigate to specific steps, with something like:
217
+
```javascript
218
+
action() {
219
+
returnthis.show('some_step_name');
220
+
}
221
+
```
222
+
-`advanceOn`: An action on the page which should advance shepherd to the next step. It should be an object with a string `selector` and an `event` name.
223
+
For example: `{selector: '.some-element', event: 'click'}`. It doesn't have to be an event inside the tour, it can be any event fired on any element on the page.
224
+
You can also always manually advance the Tour by calling `myTour.next()`.
223
225
-`highlightClass`: An extra class to apply to the `attachTo` element when it is highlighted (that is, when its step is active). You can then target that selector in your CSS.
224
226
-`id`: The string to use as the `id` for the step. If an id is not passed one will be generated.
225
227
-`modalOverlayOpeningPadding`: An amount of padding to add around the modal overlay opening
@@ -228,8 +230,9 @@ You can also always manually advance the Tour by calling `myTour.next()`.
228
230
-`showOn`: A function that, when it returns true, will show the step. If it returns false, the step will be skipped.
229
231
-`scrollTo`: Should the element be scrolled to when this step is shown? If true, uses the default `scrollIntoView`, if an object, passes that object as the params to `scrollIntoView` i.e. `{behavior: 'smooth', block: 'center'}`
230
232
-`scrollToHandler`: A function that lets you override the default `scrollTo` behavior and define a custom action to do the scrolling,
231
-
and possibly other logic.
233
+
and possibly other logic.
232
234
-`when`: You can define show, hide, etc events inside when. For example:
235
+
233
236
```javascript
234
237
when: {
235
238
show:function() {
@@ -265,14 +268,14 @@ Please note that `complete` and `cancel` are only ever triggered if you call the
265
268
266
269
### Advancing on Actions
267
270
268
-
You can use the `advanceOn` option, or the Next button, to advance steps. If you would like however to have a step advance on a
271
+
You can use the `advanceOn` option, or the Next button, to advance steps. If you would like however to have a step advance on a
0 commit comments