* Sets up the handler to determine if we should advance the tour * @param step The step instance * @param selector * @private
(step: Step, selector?: string)
| 8 | * @private |
| 9 | */ |
| 10 | function _setupAdvanceOnHandler(step: Step, selector?: string) { |
| 11 | return (event: Event) => { |
| 12 | if (step.isOpen()) { |
| 13 | const targetIsEl = step.el && event.currentTarget === step.el; |
| 14 | const targetIsSelector = |
| 15 | !isUndefined(selector) && |
| 16 | (event.currentTarget as HTMLElement).matches(selector); |
| 17 | |
| 18 | if (targetIsSelector || targetIsEl) { |
| 19 | step.tour.next(); |
| 20 | } |
| 21 | } |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Bind the event handler for advanceOn |
no test coverage detected