Added script management

This commit is contained in:
Magnus Åhall 2025-07-24 23:22:44 +02:00
parent ba7375fe15
commit 04b1325031
7 changed files with 575 additions and 4 deletions

View file

@ -6,7 +6,11 @@ export class Component {
}
render() {
const component = this.renderComponent()
this._template.content.appendChild(component)
if (typeof component[Symbol.iterator] === 'function')
this._template.content.replaceChildren(...component)
else
this._template.content.replaceChildren(component)
for (const e of this._template.content.children) {
e.setAttribute('data-component-name', this._component_name)
@ -16,13 +20,13 @@ export class Component {
e.classList.add('tooltip')
e.classList.add('left')
e.addEventListener('mouseover', event=>{
e.addEventListener('mouseover', event => {
if (event.target !== e)
return
e.style.border = '1px solid #f0f';
})
e.addEventListener('mouseout', event=>{
e.addEventListener('mouseout', event => {
if (event.target !== e)
return
e.style.border = 'none';