anki/ts/deckconfig/textInputModal.ts
Damien Elmes c3fc07ac20 more experimental updates to deck config screen
- try out bootstrap modals - they're not perfect, but let's see how
they go for now. Won't be hard to switch to bridge commands if required.
- handle adding/renaming/removing
- add a class to manage the state
2021-04-16 23:29:21 +10:00

24 lines
590 B
TypeScript

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
/* eslint
@typescript-eslint/no-non-null-assertion: "off",
*/
import TextInputModal from "./TextInputModal.svelte";
export interface TextInputModalProps {
title: string;
prompt: string;
startingValue?: string;
onOk: (string) => void;
}
export function textInputModal(props: TextInputModalProps): TextInputModal {
const target = document.getElementById("modal")!;
return new TextInputModal({
target,
props,
});
}