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() {
5959 if ( typeof this . _introBeforeChangeCallback !== "undefined" ) {
6060 continueStep = this . _introBeforeChangeCallback . call (
6161 this ,
62- nextStep && nextStep . element
62+ nextStep &&
63+ ( elementBySelectorNotExists ( nextStep ) ? undefined : nextStep . element )
6364 ) ;
6465 }
6566
@@ -79,16 +80,23 @@ export function nextStep() {
7980 return ;
8081 }
8182
82- if (
83- typeof nextStep . _element === "string" &&
84- document . querySelector ( nextStep . _element ) === null
85- ) {
83+ if ( elementBySelectorNotExists ( nextStep ) ) {
8684 waitForElement ( nextStep . _element , ( ) => showElement . call ( this , nextStep ) ) ;
8785 } else {
8886 showElement . call ( this , nextStep ) ;
8987 }
9088}
9189
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+
92100/**
93101 * Go to previous step on intro
94102 *
You can’t perform that action at this time.
0 commit comments