Refactor filesize component to slot

This commit is contained in:
Talia 2022-06-22 16:00:10 +02:00
parent fe7c27258e
commit 912909836c

View file

@ -27,7 +27,7 @@ element(class FileSize extends HTMLElement {
.then(response=>response.arrayBuffer()) .then(response=>response.arrayBuffer())
.then(buffer => buffer.byteLength) .then(buffer => buffer.byteLength)
.then(length => { .then(length => {
this.shadowRoot.replaceChildren(text`${fragment(...this.cloneChildren())} (${length} Bytes unminified)`) this.shadowRoot.replaceChildren(text`${html.slot()} (${length} Bytes unminified)`)
}) })
} }
} }