From dee26817440a4e115f769466f0f0114cc0343c24 Mon Sep 17 00:00:00 2001 From: Milo Date: Mon, 12 Aug 2019 12:26:55 +0100 Subject: [PATCH] Tour is completed once you exit / finish the tour. Changed the final step so that it uses this.get_buttons() and altered the function a bit. --- client_src/js/Tour.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client_src/js/Tour.mjs b/client_src/js/Tour.mjs index 07ded9c..ffd0d9b 100644 --- a/client_src/js/Tour.mjs +++ b/client_src/js/Tour.mjs @@ -126,7 +126,7 @@ class Tour { text: "Tour complete!\nIf you need any additional assistance, let us know :-)", buttons: [ { text: "Previous", action: this.tour.back }, - { text: "Done", action: this.tour.next } + { text: "Done", action: this.tour.cancel } //Changed from next to cancel for ease ] }); } @@ -135,7 +135,7 @@ class Tour { if(window.localStorage.getItem("completed_tour") === null) this.run(); - window.localStorage.setItem("completed_tour", (new Date()).toISOString()); + //window.localStorage.setItem("completed_tour", (new Date()).toISOString()); -- removed due to an accidental refresh possiblity } run() { @@ -147,7 +147,11 @@ class Tour { get_buttons(no_continue = false, no_prev = false) { let next = { text: "Next", action: this.tour.next }, prev = { text: "Previous", action: this.tour.back }, - exit = { text: "Exit", action: this.tour.cancel }; + exit = { text: "Exit", action: () => + { + window.localStorage.setItem("completed_tour", (new Date()).toISOString()); + this.tour.cancel() + } }; let result = []; if(!no_prev) result.push(prev);