pull/1/head
Jan Umbach 2024-05-30 12:06:30 +02:00
parent 741ae83498
commit 1597d5da9b
2 changed files with 8 additions and 1 deletions

View File

@ -978,7 +978,7 @@ class VariantSelects extends HTMLElement {
this.updateMasterId(); this.updateMasterId();
document.querySelectorAll('shx-drehteller').forEach((drehteller) => { document.querySelectorAll('shx-drehteller').forEach((drehteller) => {
drehteller.reloadCurrentVariant(this.currentVariant.featured_image.alt); drehteller.initCurrentVariant(this.currentVariant.featured_image.alt);
console.log("drehteller INIT", drehteller); console.log("drehteller INIT", drehteller);
}); });
} }

View File

@ -27,6 +27,13 @@
// edit inner html // edit inner html
this.shadowRoot.innerHTML = `<div>Current variant: ${this.currentVariant}</div>`; this.shadowRoot.innerHTML = `<div>Current variant: ${this.currentVariant}</div>`;
} }
initCurrentVariant(id) {
this.currentVariant = id;
// edit inner html
this.shadowRoot.innerHTML = `<div>Init variant: ${this.currentVariant}</div>`;
}
} }
customElements.define('shx-drehteller', MyCustomElement); customElements.define('shx-drehteller', MyCustomElement);