24 lines
709 B
Plaintext
24 lines
709 B
Plaintext
{% assign content_type = content_type | default: 'awdawd' %}
|
|
|
|
{% if content_type == 'init' %}
|
|
|
|
<script type="text/javascript">
|
|
// create new html tag called "shx-drehteller"
|
|
|
|
class MyCustomElement extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
// element functionality written in here
|
|
}
|
|
|
|
connectedCallback() {
|
|
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.
|
|
}
|
|
}
|
|
|
|
customElements.define('shx-drehteller', MyCustomElement);
|
|
</script>
|
|
|
|
|
|
{% endif %} |