From a0e403c3dd76d1743fc2c2b00399955204c2dbe0 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 3 Nov 2022 11:37:47 +1000 Subject: [PATCH] Allow passing startup props to setupCardInfo() Add-ons that use it and don't want the revlog can pass in includeRevlog:false Issue noticed while addressing https://forums.ankiweb.net/t/card-info-during-review/86/12 in https://github.com/ankitects/anki-addons/commit/c86da082b494805cd8fe46df61f9d4aede2f65da --- ts/card-info/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ts/card-info/index.ts b/ts/card-info/index.ts index c6e29bcbb..a30a2cbfe 100644 --- a/ts/card-info/index.ts +++ b/ts/card-info/index.ts @@ -11,11 +11,14 @@ const i18n = setupI18n({ modules: [ModuleName.CARD_STATS, ModuleName.SCHEDULING, ModuleName.STATISTICS], }); -export async function setupCardInfo(target: HTMLElement): Promise { +export async function setupCardInfo( + target: HTMLElement, + props = {}, +): Promise { checkNightMode(); await i18n; - return new CardInfo({ target, props: {} }); + return new CardInfo({ target, props }); } if (window.location.hash.startsWith("#test")) {