29 lines
669 B
JavaScript
29 lines
669 B
JavaScript
class Akordeon extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
this._internals = this.attachInternals();
|
|
}
|
|
|
|
get collapsed() {
|
|
return this._internals.states.has("hidden");
|
|
}
|
|
|
|
set collapsed(flag) {
|
|
if (flag) {
|
|
// Existence of identifier corresponds to "true"
|
|
this._internals.states.add("hidden");
|
|
} else {
|
|
// Absence of identifier corresponds to "false"
|
|
this._internals.states.delete("hidden");
|
|
}
|
|
}
|
|
|
|
connecterCallback() {
|
|
}
|
|
|
|
attributeChangedCallback(atrybut, poprzednio, obecnie) {
|
|
|
|
}
|
|
}
|
|
|
|
customElements.define("akordeon", Akordeon); |