diff --git a/app/assets/javascripts/walter/index.js b/app/assets/javascripts/walter/index.js index 0e0a5e0..63f6767 100644 --- a/app/assets/javascripts/walter/index.js +++ b/app/assets/javascripts/walter/index.js @@ -7,7 +7,7 @@ Walter.tours = {}; Walter.incompleteTours = []; Walter.startTour = function(tourName) { if (!Shepherd.activeTour) { - Walter.tours[tourName].start(); + setTimeout(function(){Walter.tours[tourName].start()}, 300); } }; Walter.startNextIncompleteTour = function() { diff --git a/app/helpers/walter_helper.rb b/app/helpers/walter_helper.rb index b1be79d..096c200 100644 --- a/app/helpers/walter_helper.rb +++ b/app/helpers/walter_helper.rb @@ -25,6 +25,7 @@ module WalterHelper locals: { tour_name: key, tour_completed: tour_keys_completed.include?(key), trigger: tours[key]["trigger"], + tour_delay: tours[key]['delay']||500, steps: tours[key]["steps"] })) end tour_html.html_safe diff --git a/app/views/application/_shepherd.html.erb b/app/views/application/_shepherd.html.erb index bb614b5..2e6bd10 100644 --- a/app/views/application/_shepherd.html.erb +++ b/app/views/application/_shepherd.html.erb @@ -65,7 +65,7 @@ <% end %> if (tourMayStart) { - start(); + setTimeout(function(){start();}, <%= tour_delay %>); // need to delay this } } }(Walter.tours["<%= tour_name %>"].start)