mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-18 23:04:30 +08:00
impr: add option to pass modal show settings through the show commandline function
This commit is contained in:
parent
41cb95b43e
commit
40aa1e61f8
2 changed files with 7 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ import Config from "../config";
|
|||
import * as AnalyticsController from "../controllers/analytics-controller";
|
||||
import * as ThemeController from "../controllers/theme-controller";
|
||||
import { clearFontPreview } from "../ui";
|
||||
import AnimatedModal from "../popups/animated-modal";
|
||||
import AnimatedModal, { ShowHideOptions } from "../popups/animated-modal";
|
||||
import * as Notifications from "../elements/notifications";
|
||||
|
||||
type CommandlineMode = "search" | "input";
|
||||
|
|
@ -49,8 +49,12 @@ type ShowSettings = {
|
|||
singleListOverride?: boolean;
|
||||
};
|
||||
|
||||
export function show(settings?: ShowSettings): void {
|
||||
export function show(
|
||||
settings?: ShowSettings,
|
||||
modalShowSettings?: ShowHideOptions
|
||||
): void {
|
||||
void modal.show({
|
||||
...modalShowSettings,
|
||||
beforeAnimation: async (modal) => {
|
||||
mouseMode = false;
|
||||
inputValue = "";
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ type ConstructorCustomAnimations = {
|
|||
hide?: CustomWrapperAndModalAnimations;
|
||||
};
|
||||
|
||||
type ShowHideOptions = {
|
||||
export type ShowHideOptions = {
|
||||
animationMode?: "none" | "both" | "modalOnly";
|
||||
customAnimation?: CustomWrapperAndModalAnimations;
|
||||
beforeAnimation?: (modal: HTMLElement) => Promise<void>;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue