mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added distinction between basic and advanced mode
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user