Browse Source

P4TB-213: Hide Back/Next buttons as appropriate instead of disabling them.

1.1.101
Jorg Knobloch 2 years ago
parent
commit
cd236fdd10
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      addon/content/tutorial/tutorial.js

+ 7
- 7
addon/content/tutorial/tutorial.js View File

@ -5,17 +5,17 @@ function updateButtons(iframeSrc) {
let nextButton = document.getElementById("nextButton");
switch (iframeSrc) {
case "tutorial-1.html":
backButton.disabled = true;
nextButton.disabled = false;
backButton.hidden = true;
nextButton.hidden = false;
break;
case "tutorial-2.html":
case "tutorial-3.html":
backButton.disabled = false;
nextButton.disabled = false;
backButton.hidden = false;
nextButton.hidden = false;
break;
case "tutorial-4.html":
backButton.disabled = false;
nextButton.disabled = true;
backButton.hidden = false;
nextButton.hidden = true;
break;
default:
}
@ -38,7 +38,7 @@ function next() {
window.addEventListener("load", () => {
let backButton = document.getElementById("backButton");
let nextButton = document.getElementById("nextButton");
backButton.disabled = true;
backButton.hidden = true;
// The following can't be done in the HTML file, see last section of:
// eslint-disable-next-line max-len
// https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy#Location_of_script_and_object_resources


Loading…
Cancel
Save