-
Notifications
You must be signed in to change notification settings - Fork 940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload page after tour ends, onStart fires but not onEnd #720
Comments
Firing onEnd when it is decided NOT to start the tour -- Looks like the showStep function needs the following 1 line addition:
Not firing onStart (and not calling showStep) can be done in Tour.prototype.start:
|
I'm going to add this to my fork, but with slightly altered behavior - if tour start is called when tour has previously ended, it'll call onPreviouslyEnded (or something similar). I think calling the end callback when the tour hasn't shown itself could cause some unintended side effects in app logic. You wouldn't want to call an end without calling start, because logically why would the end callback get fired without a start callback (introduces potential for bugs if, say, end callback expects something to be done in start callback). And you wouldn't call start callback if the tour isn't actually started. |
Agree with your logic, but I implemented both of what I posted. I don't know the code as well as you probably do, but looks like showStep is called to show each step. So it might be possible that two browser tabs are open showing the tour and tab #2 ends the tour. Then in tab #1 when show step is called will end the tour and really should call the onEnd callback. Just my two cents. I also found a scrolling bug and will file another issue with my fix. Perhaps you are aware of it in your fork, but in case not.... |
That's a very good - but somewhat strange! - case, I didn't think of that one. I've implemented a slightly different solution because we need to handle 2 scenarios.
This solves the 2 use cases, I think? |
if after the endTour and you recharge your page your guide replay no longer uses the init. use the tour.start like this function startTour(e) { |
I've created a new repo for the fork of bootstrap-tour: /~https://github.com/IGreatlyDislikeJavascript/bootstrap-tourist This should help avoid confusion in the fork etc. I've fixed this in the fork. |
Load page with unstarted BSTour and onStart fires, Tour is shown. Click End Tour and onEnd fires.
Reload the page. onStart fires, Tour is not shown and BSTour debug reports:
But no onEnd fires.
Either onStart should not fire when tour is not actually started OR onEnd should fire to show that the tour has ended.
Here is the code used in this test:
The text was updated successfully, but these errors were encountered: