From eac3fd04270447492e0737f1a2defc6fc976157c Mon Sep 17 00:00:00 2001 From: Rachel Roppolo Date: Tue, 7 Jan 2020 08:38:57 -0800 Subject: [PATCH] Include check for 'later' cookie within start method of tour (#27) Thanks @rroppolo! --- app/views/application/_abraham.html.erb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/application/_abraham.html.erb b/app/views/application/_abraham.html.erb index ffec748..a743d5d 100644 --- a/app/views/application/_abraham.html.erb +++ b/app/views/application/_abraham.html.erb @@ -51,8 +51,14 @@ }); <% end %> - // Don't start the tour if the user dismissed it once this session - if (!Cookies.get('<%= abraham_cookie_prefix %>-<%= tour_name %>', { domain: '<%= abraham_domain %>' })) { - tour.start(); - } + tour.start = function (start) { + return function () { + // Don't start the tour if the user dismissed it once this session + if (!Cookies.get('<%= abraham_cookie_prefix %>-<%= tour_name %>', {domain: '<%= abraham_domain %>'})) { + start(); + } + } + }(tour.start) + + tour.start()