Open beard7 opened 6 years ago
The documentation is correct if you depend on some functions of the Tour before starting it (exemple of getCurrentStep which will be null if you skip the init) But yeah, the tour can start without init because init is called from start if not initialised.
Edit: I knew I missed something ! I removed the following block from the Init method to keep it to initialisation
if (this._current !== null) {
this.showStep(this._current);
}
Doing this does have a negative consequence - it prevents multi page tours, or tours from continuing at previous step after page reload.
My fork fixes this problem. Use my fork, do not call init(). Call start() to begin the tour OR to resume tour from last viewed step. Call restart() to start the tour from first step.
The documentation states that
init()
needs to be called beforestart()
, but as far as I can tell, this is unnecessary: the tour starts perfectly well by just callingstart()
orrestart()
I discovered this is after I removed
tour.init()
because I was getting an error:Cannot read property 'backdrop' of undefined
Removing
tour.init()
fixes the error and has no negative consequences.