Web Dev Solutions

Catalin Mititiuc

class SoldierRecordBlock extends HTMLDivElement { constructor() { super(); let template = document.getElementById('soldier-record-block'); let templateContent = template.content; const shadowRoot = this.attachShadow({ mode: "open" }); shadowRoot.appendChild(templateContent.cloneNode(true)); // console.log(shadowRoot) // this.shadowRoot // .querySelectorAll('p:has(input[type="number"]), .physical-status-track') // .forEach(el => el.addEventListener('click', e => e.stopPropagation())) // ; } } customElements.define( 'damage-block', class extends HTMLSpanElement { constructor() { super(); let template = document.getElementById('damage-block'); let templateContent = template.content; const shadowRoot = this.attachShadow({ mode: "open" }); shadowRoot.appendChild(templateContent.cloneNode(true)); } }, { extends: 'span' } ); customElements.define( 'soldier-record-block', SoldierRecordBlock, { extends: 'div'} );