anki/ts/editor-toolbar/index.ts

21 lines
530 B
TypeScript
Raw Normal View History

2021-03-25 21:11:40 +01:00
import type { SvelteComponent } from "svelte";
import { checkNightMode } from "anki/nightmode";
import EditorToolbarSvelte from "./EditorToolbar.svelte";
class EditorToolbar extends HTMLElement {
component?: SvelteComponent;
2021-03-25 23:32:23 +01:00
connectedCallback(): void {
2021-03-25 21:11:40 +01:00
const nightMode = checkNightMode();
this.component = new EditorToolbarSvelte({
target: this,
props: {
nightMode,
},
});
}
}
customElements.define("anki-editor-toolbar", EditorToolbar);