mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Export module functions from EditorToolbar
This commit is contained in:
parent
0baf14dc8b
commit
982c85ded6
3 changed files with 12 additions and 6 deletions
|
@ -141,6 +141,7 @@ esbuild(
|
||||||
"editor_ts",
|
"editor_ts",
|
||||||
"local_css",
|
"local_css",
|
||||||
"svelte_components",
|
"svelte_components",
|
||||||
|
"//ts/components",
|
||||||
"//ts/components:svelte_components",
|
"//ts/components:svelte_components",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,6 +15,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
export function disableButtons(): void {
|
export function disableButtons(): void {
|
||||||
disabled.set(true);
|
disabled.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { updateAllState, resetAllState } from "components/WithState.svelte";
|
||||||
|
|
||||||
|
export function updateActiveButtons(event: Event) {
|
||||||
|
updateAllState(event)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function clearActiveButtons() {
|
||||||
|
resetAllState(false);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
|
|
|
@ -33,10 +33,5 @@ export function initToolbar(i18n: Promise<void>): Promise<EditorToolbar> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exports for editor */
|
/* Exports for editor */
|
||||||
export {
|
|
||||||
updateAllState as updateActiveButtons,
|
|
||||||
resetAllState as clearActiveButtons,
|
|
||||||
} from "components/WithState.svelte";
|
|
||||||
|
|
||||||
// @ts-expect-error insufficient typing of svelte modules
|
// @ts-expect-error insufficient typing of svelte modules
|
||||||
export { enableButtons, disableButtons } from "./EditorToolbar.svelte";
|
export { enableButtons, disableButtons, updateActiveButtons, clearActiveButtons } from "./EditorToolbar.svelte";
|
||||||
|
|
Loading…
Reference in a new issue