DaftMonk / angular-tour

AngularJS directive for giving an interactive tour of your website.
http://daftmonk.github.io/angular-tour/
MIT License
609 stars 137 forks source link

Question about steps #20

Open mistafi opened 9 years ago

mistafi commented 9 years ago

Greetings! Good work.

While adding walkthrough to one of my projects, I noticed that when I close the tour when it first opens using closeTour() - openTour() no longer fires.

This is problematic as a user may want to close it immediately, but come back to it later.

I also tried keeping the tour from firing on page load, but that did not work either.

Your help is appreciated!

mistafi commented 9 years ago

After researching this more, it does fire, but it appears that some is wrong in self.currentStep.

In this line: var startStep = self.currentStep >= steps.getCount() || self.currentStep < 0 ? 0 : self.currentStep;

If you change it to:

var startStep=self.currentStep>=steps.getCount()||self.currentStep<0?0:0;

The functionality comes back.

I was also trying to figure out a solution to keep it from firing every time I hit the page.

For some reason, the cookie never logs, although the $scope can be logged out.

In any case, setting self.currentStep = -1 keeps it from firing at page load.

I do not see this as a definitive solution, as this feels hacky and dirty, but it works...please comment if anyone knows a better way.

Jose-27 commented 9 years ago

Thanks for That

mbuttu commented 9 years ago

I was able to fix this by setting $scope.currentStep = 0; in the controller.