Re-Implemented Div-Menu

This commit is contained in:
Simon Martens
2025-06-04 19:52:52 +02:00
parent 715be79115
commit 3a6dcc0e3d
7 changed files with 413 additions and 640 deletions

View File

@@ -65,7 +65,9 @@ export class ResetButton extends HTMLElement {
el.removeEventListener("change", this.handleInputChange);
});
this._controlledElements = [];
this.initialStates.clear();
// INFO: we don't clear the intitial states here, in case we
// want to reattach the same elements later.
// this.initialStates.clear();
this.lastOverallModifiedState = null;
const controlIds = (this.getAttribute("controls") || "")
@@ -107,6 +109,9 @@ export class ResetButton extends HTMLElement {
}
storeInitialState(element) {
if (this.initialStates.has(element.id)) {
return;
}
let state;
switch (element.type) {
case "checkbox":