mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
17 lines
549 B
JavaScript
17 lines
549 B
JavaScript
import { loadCSS } from "../helpers/loader.js";
|
|
import assert from "../lib/assert.js";
|
|
|
|
export default class ComponentFab extends HTMLButtonElement {
|
|
constructor() {
|
|
super();
|
|
this.innerHTML = `<div class="content"></div>`;
|
|
this.classList.add("component_fab");
|
|
}
|
|
|
|
async render($icon) {
|
|
await loadCSS(import.meta.url, "./fab.css");
|
|
assert.type(this.querySelector(".content"), HTMLElement).replaceChildren($icon);
|
|
}
|
|
}
|
|
|
|
customElements.define("component-fab", ComponentFab, { extends: "button" });
|