test
parent
f332430a2b
commit
537b8c99c4
|
@ -1090,6 +1090,10 @@ class VariantSelects extends HTMLElement {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
document.querySelectorAll('shx-drehteller').forEach((drehteller) => {
|
||||||
|
drehteller.reloadCurrentVariant(this.currentVariant.featured_image.alt);
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// show all thumbnails
|
// show all thumbnails
|
||||||
document.querySelectorAll('[thumbnail-alt]').forEach((thumbnail) => {
|
document.querySelectorAll('[thumbnail-alt]').forEach((thumbnail) => {
|
||||||
|
|
|
@ -9,12 +9,24 @@
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
// element functionality written in here
|
// element functionality written in here
|
||||||
|
this.currentVariant = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
this.attachShadow({ mode: 'open' }); // Attach a shadow root to the element.
|
this.attachShadow({ mode: 'open' }); // Attach a shadow root to the element.
|
||||||
this.shadowRoot.innerHTML = `<div>Hello, world!</div>`; // Add a div to the shadow DOM.
|
this.shadowRoot.innerHTML = `<div>Hello, world!</div>`; // Add a div to the shadow DOM.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disconnectedCallback() {
|
||||||
|
// Clean up the element when it is removed from the DOM.
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadCurrentVariant(id) {
|
||||||
|
this.currentVariant = id;
|
||||||
|
|
||||||
|
// edit inner html
|
||||||
|
this.shadowRoot.innerHTML = `<div>Current variant: ${this.currentVariant}</div>`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
customElements.define('shx-drehteller', MyCustomElement);
|
customElements.define('shx-drehteller', MyCustomElement);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% if video_src != 'none' %}
|
{% if video_src != 'none' %}
|
||||||
<div class="shx-video">
|
<div class="shx-video">
|
||||||
<div class="shx-video__wrapper">
|
<div class="shx-video__wrapper">
|
||||||
{%- echo media | media_tag: image_size: "2048x", autoplay: true, loop: true, controls: false, preload: "none" -%}
|
{%- echo media | media_tag: image_size: "2048x", autoplay: true, muted: true, loop: true, controls: false, preload: "none" -%}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue