File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ export function nextStep() {
59
59
if ( typeof this . _introBeforeChangeCallback !== "undefined" ) {
60
60
continueStep = this . _introBeforeChangeCallback . call (
61
61
this ,
62
- nextStep && nextStep . element
62
+ nextStep &&
63
+ ( elementBySelectorNotExists ( nextStep ) ? undefined : nextStep . element )
63
64
) ;
64
65
}
65
66
@@ -79,16 +80,23 @@ export function nextStep() {
79
80
return ;
80
81
}
81
82
82
- if (
83
- typeof nextStep . _element === "string" &&
84
- document . querySelector ( nextStep . _element ) === null
85
- ) {
83
+ if ( elementBySelectorNotExists ( nextStep ) ) {
86
84
waitForElement ( nextStep . _element , ( ) => showElement . call ( this , nextStep ) ) ;
87
85
} else {
88
86
showElement . call ( this , nextStep ) ;
89
87
}
90
88
}
91
89
90
+ /**
91
+ * Return true if element locates by selector and doesn't exists yet
92
+ */
93
+ function elementBySelectorNotExists ( step ) {
94
+ return (
95
+ typeof step . _element === "string" &&
96
+ document . querySelector ( step . _element ) === null
97
+ ) ;
98
+ }
99
+
92
100
/**
93
101
* Go to previous step on intro
94
102
*
You can’t perform that action at this time.
0 commit comments