mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
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.
This commit is contained in:
parent
5a5bf193dd
commit
dee2681744
1 changed files with 7 additions and 3 deletions
|
@ -126,7 +126,7 @@ class Tour {
|
||||||
text: "Tour complete!\nIf you need any additional assistance, let us know :-)",
|
text: "Tour complete!\nIf you need any additional assistance, let us know :-)",
|
||||||
buttons: [
|
buttons: [
|
||||||
{ text: "Previous", action: this.tour.back },
|
{ 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)
|
if(window.localStorage.getItem("completed_tour") === null)
|
||||||
this.run();
|
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() {
|
run() {
|
||||||
|
@ -147,7 +147,11 @@ class Tour {
|
||||||
get_buttons(no_continue = false, no_prev = false) {
|
get_buttons(no_continue = false, no_prev = false) {
|
||||||
let next = { text: "Next", action: this.tour.next },
|
let next = { text: "Next", action: this.tour.next },
|
||||||
prev = { text: "Previous", action: this.tour.back },
|
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 = [];
|
let result = [];
|
||||||
if(!no_prev) result.push(prev);
|
if(!no_prev) result.push(prev);
|
||||||
|
|
Loading…
Reference in a new issue