Added distinction between basic and advanced mode

This commit is contained in:
Pax1601
2024-01-13 10:01:30 +01:00
parent 0f0ba4c725
commit d56a95cfa3
28 changed files with 1251 additions and 446 deletions

View File

@@ -1,8 +1,11 @@
class ManagerPage {
manager;
element;
options;
previousPage;
constructor(options) {
constructor(manager, options) {
this.manager = manager;
this.options = options ?? {};
this.element = document.createElement('div');
this.element.classList.add("manager-page", "hide");
@@ -12,8 +15,11 @@ class ManagerPage {
return this.element;
}
show() {
show(previousPage) {
this.element.classList.remove("hide");
if (previousPage !== undefined)
this.previousPage = previousPage;
}
hide() {
@@ -28,6 +34,21 @@ class ManagerPage {
buttons[i].classList.toggle("open");
})
}
/* Connect the back, next and cancel buttons */
if (this.element.querySelector(".back"))
this.element.querySelector(".back").addEventListener("click", (e) => this.onBackClicked(e));
if (this.element.querySelector(".next"))
this.element.querySelector(".next").addEventListener("click", (e) => this.onNextClicked(e));
if (this.element.querySelector(".cancel"))
this.element.querySelector(".cancel").addEventListener("click", (e) => this.onCancelClicked(e));
}
onBackClicked() {
this.hide();
this.previousPage.show()
}
}