benmarch / angular-bootstrap-tour

AngularJS wrapper around Bootstrap Tour
64 stars 27 forks source link

Angular Bootstrap tour 'end tour' when clicked stops the tour for good #35

Open Prasadambulkar3 opened 9 years ago

Prasadambulkar3 commented 9 years ago

I have a tour currently running on my site, but it doesn't seem to actually keep track of if the user has clicked End Tour. Meaning that if they click it once, it ends the tour, but then when they revisit the page the tour will automatically start again.

benmarch commented 9 years ago

Can you paste your tour config here? Just the element with the tour directive on it is good.

Prasadambulkar3 commented 9 years ago

Using same tour config in repository

benmarch commented 9 years ago

If you are referring to the config in the demo then remove the storage="false" attribute from the tour element. Setting it to false tells it not to keep track of tour position.

Prasadambulkar3 commented 9 years ago

I removed it but when I click on "End Tour" it stops the tour and when I clicked on next button it stops the tour and start again and after revisit the same page where I clicked on "End Tour" in case of multipage it opens the tour again from last stopped position.

benmarch commented 9 years ago

I think I may have misunderstood what you are trying to do. Are you trying to prevent users from seeing the tour more than once? If that is the case, you will have to keep track of that in your application. This is a limitation of the underlying library Bootstrap Tour that is used to power this one. When the tour is ended, save some state in your app that is checked when a user tries to start up the tour again, and prevent that action if the user has already run it.

Please let me know if this is not what you are trying to do.

Prasadambulkar3 commented 9 years ago

I have implemented this tour for multipage, if on some page I click on end tour button tour ends.But when revisit that page tour opens again without performing any action.

benmarch commented 9 years ago

Ohh ok i understand. I can try to reproduce this but it would be much easier if you could paste some of your code here. Specifically, the tour config, the trigger for starting the tour, and the tour step that takes you to the second page. If you can provide that information for me I will use it to debug the issue.

Prasadambulkar3 commented 9 years ago
<body ng-controller="MainController as main" class="{{$state.current.data.specialClass}}" tour on-end="onTourEnd(tour)" landing-scrollspy id="page-top">
<a ng-click="tour.restart(true)">
     <i class="fa fa-plane"></i>
</a>

for first page:

 <div class="" tour-step="msgBlaster" placement="bottom" title="msgBlaster" content="Welcome to msgBlaster." order="0" next-path="app/contacts" next-step="groupList">

for second:

  <div class="" tour-step="groupList" placement="top" title="Contact Groups" content="These are groups for contacts" order="1" next-path="app/contactList" next-step="contactList" prev-path="app/dashboard" prev-step="msgBlaster">

for third:

<div id="Contact" class="" dropdown tour-step="contactList" placement="top" title="Contacts" content="By selecting this you can upload contacts" order="2" next-path="/app/importContacts" next-step="importContacts" prev-path="app/contacts" prev-step="groupList">

and use same angular-bootstrap-tour.js, bootstrap-tour.js provided in this repo.

benmarch commented 9 years ago

Cool, thank you, I will play around with this and get back to you.